Tomasz
|
| Posted: 04/21/2002, 12:48 PM |
|
$sum="SELECT COUNT(*) as record_selected FROM opinie";
$db->query($sum);
$how_many = $db->f("record_selected");
echo $how_many;
display nothing.
why?
|
|
|
 |
Nicole
|
| Posted: 04/22/2002, 4:46 AM |
|
Hello,
the code looks correct. Are you sure the table is not empty?
|
|
|
 |
Tomasz
|
| Posted: 04/24/2002, 6:53 AM |
|
I received answer from Alex as follows:
------------------------------------------
Your use of phplib functions is incorrect.
You didn't move resulset "pointer".
Should be
$sum="SELECT COUNT(*) as record_selected FROM opinie";
$db->query($sum);
if ($db->next_record()) {
$how_many = $db->f("record_selected");
echo $how_many;
}
------------------------------------------
|
|
|
 |
|