2
I need to know how many records there are within my table and add the total find into one variable. I’m doing it this way but it doesn’t work:
<?php
$w_querybusca = "SELECT * FROM Elem_matr;";
$w_queryresultado=f_class_conecta_bd($w_querybusca);
$result = pg_num_rows($w_queryresultado);
echo $result;
?>
You should do it in what way?
The problem is: With this example above it only shows the values within the table. What I need is the total contained within this table!
I am using Postgresql
– Alexandre
Can you describe better what doesn’t work? of an error? of a
print_rin$w_queryresultado– rray
Well, what doesn’t work is that the returned value is 1. And the total of records within the table passes 500.
– Alexandre
Could you put the code
f_class_conecta_bd– rray
@lost I do not have access to the bank connection, so I will not be able to show you this.
– Alexandre
Let’s go continue this discussion in chat.
– rray
Proxy restriction -.- ! And yes, being small fish in the company is tricky!
– Alexandre
The
print_rreturns 1 or an array with a few more keys?– rray
The
print_rreturns 1– Alexandre
See if this code changes the return:
$w_querybusca = "SELECT COUNT (seq_elem) as total FROM \"Elem_matr\"";
 $w_queryresultado=f_class_conecta_bd($w_querybusca);
echo $w_queryresultado['total'];– rray
This passage that you passed "previously", returns nothing, is blank!
– Alexandre
Add these two lines at the beginning of the file and see if any errors appear:
ini_set('display_errors', true); error_reporting(E_ALL);– rray
I already solved the problem, it was a certain function of the own
PostgreSQL.– Alexandre
No need to put
resolvidoin the title, you can mark the reply as accepted withV. why and how to accept an answer– rray
It is because if the very person who asked answered. Just to accept in 2 days! There is no mistake with those who visualize this question, I put the solved. But in 2 days I edit!
– Alexandre