Yep..., it's Friday.... brain has left the building....


alex hogan


> -----Original Message-----
> From: Richard Davey [mailto:[EMAIL PROTECTED]
> Sent: Friday, March 05, 2004 1:46 PM
> To: PHP General list
> Subject: Re: [PHP] Returning only a row count of 1?
> 
> Hello Alex,
> 
> Friday, March 5, 2004, 7:40:08 PM, you wrote:
> 
> AH> I have 6 records in this table but using this code;
> 
> AH> $querytotalcount = "SELECT COUNT(*)
> AH>                               FROM CF_Survey";
> 
> AH> $totalrows = mssql_num_rows($resulttotalcount);
> 
> AH> I only return a count of 1.
> 
> It will only return 1 row because that's all you've asked it to return
> - a count of the number of records.
> 
> This is for MySQL but you'll get the idea:
> 
> $sql = "SELECT COUNT(*) AS hits FROM CF_Survey";
> $hits = mysql_result($result, 0, "hits");
> 
> Run your query directly in MSSQL and you'll see what gets returned.
> 
> --
> Best regards,
>  Richard Davey
>  http://www.phpcommunity.org/wiki/296.html
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php


****************************************************************** 
The contents of this e-mail and any files transmitted with it are 
confidential and intended solely for the use of the individual or 
entity to whom it is addressed.  The views stated herein do not 
necessarily represent the view of the company.  If you are not the 
intended recipient of this e-mail you may not copy, forward, 
disclose, or otherwise use it or any part of it in any form 
whatsoever.  If you have received this e-mail in error please 
e-mail the sender. 
****************************************************************** 


Reply via email to