CodeCharge Studio
search Register Login  

Visual Web Reporting

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> Archive -> CodeCharge.Discussion

 simple count - why not working?..

Print topic Send  topic

Author Message
Tomasz
Posted: 04/21/2002, 12:54 PM

$sum="SELECT COUNT(*) as record_selected FROM opinie";
$db->query($sum);
$how_many = $db->f("record_selected");
echo $how_many;


display nothing.
why?
Alexey Alexapolsky
Posted: 04/22/2002, 2:43 AM

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

--
Alex
CodeCharge Developer


"Tomasz" <tomasz@REMOVENOSPAMmax.pl> wrote in message
news:Xns91F7DEC06594Ctomasz@66.180.229.147...
> $sum="SELECT COUNT(*) as record_selected FROM opinie";
> $db->query($sum);
> $how_many = $db->f("record_selected");
> echo $how_many;
>
>
> display nothing.
> why?

Tomasz
Posted: 04/22/2002, 7:31 AM

.... Zdaje się, że w Pn, 22 kwi 2002 09:37:19 GMT Alexey Alexapolsky
napisał (a):

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

thx Alex

   


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

MS Access to Web

Convert MS Access to Web.
Join thousands of Web developers who build Web applications with minimal coding.

CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


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