Re: [PHP] mysql_numrows

2001-08-06 Thread Daniel Rezny

Hello AJDIN,

Monday, August 06, 2001, 3:34:49 PM, you wrote:

AB Hi

AB I'm trying to get number of rows from a query. All works fine until 
AB the result is 0.  Then query executes fine, returns 0 rows but mysql_numrows 
AB failes.

AB $query=select * from mytable;
AB $result=mysql_query($query) or die(select failed);
AB $num_rows=mysql_numrows($result) or die(select count failed);

do it like this:
$num_rows=@mysql_numrows($result) or die(select count failed);
  ^
  if you give there this character it don't give you a error.

I hope it helps

-- 
Best regards,
 Danielmailto:[EMAIL PROTECTED]


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] mysql_numrows

2001-08-06 Thread Sam Masiello


I believe the function you want is mysql_num_rows, not mysql_numrows

HTH

Sam Masiello
Software Quality Assurance Engineer
Synacor
(716) 853-1362 x289
[EMAIL PROTECTED]

 -Original Message-
From:   AJDIN BRANDIC [mailto:[EMAIL PROTECTED]]
Sent:   Monday, August 06, 2001 9:35 AM
To: [EMAIL PROTECTED]
Subject:[PHP] mysql_numrows

Hi

I'm trying to get number of rows from a query. All works fine until
the result is 0.  Then query executes fine, returns 0 rows but mysql_numrows
failes.

$query=select * from mytable;
$result=mysql_query($query) or die(select failed);
$num_rows=mysql_numrows($result) or die(select count failed);

Displays selec count failed but it should just return 0 so $numrows=0.

If or die bit is removed, then all works fine.

Any way around this problem?


Regards

Ajdin

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]