note 83279 deleted from function.mysql-num-rows by nlopess
| From: | nlopess@php.net | Date: | Mon, 19 May 2008 15:16:09 +0000 |
| Subject: | note 83279 deleted from function.mysql-num-rows by nlopess | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-139530@lists.php.net to get a copy of this message | ||
Note Submitter: Bill
----
My website was moved to a different server. PHP 4.4.4 was on the old server and PHP 5.2.5 on the
new server.
On PHP 4.4.4 the following code worked:
if(mysql_num_rows($result) == 1) {
echo "one row";
}
and produced "one row" as the result.
One PHP 5.2.5 I had to change the code to:
$num_rows = mysql_num_rows($result);
if($num_rows == 1) {
echo "one row";
}
to get the identical result. Don't know whether this is a bug or a feature but it sure wasted
alot of my time. I hope someone benefits from this remark.
This is my first comment on php.net and I've been using PHP for a decade. The PHP developers
and the folks that post comments have created one of the most valuable software resources ever.
Thanks!