CodeCharge Studio
search Register Login  

Visual PHP Web Development

Visually Create Internationalized Web Applications, Web Reports, Calendars, and more.
CodeCharge.com

YesSoftware Forums -> Archive -> GotoCode Archive

 simple count - why not working?.

Print topic Send  topic

Author Message
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;
}
------------------------------------------

   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

Internet Database

Visually create Web enabled database applications in minutes.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.