note 83279 added to function.mysql-num-rows
| From: | Bill at osu1 dot php dot net | Date: | Sun, 18 May 2008 22:35:36 +0000 |
| Subject: | note 83279 added to function.mysql-num-rows | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-139508@lists.php.net to get a copy of this message | ||
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!
----
Server IP: 64.71.164.2
Probable Submitter: 24.99.250.72
----
Manual Page -- http://www.php.net/manual/en/function.mysql-num-rows.php
Edit -- https://master.php.net/note/edit/83279
Del: integrated -- https://master.php.net/note/delete/83279/integrated
Del: useless -- https://master.php.net/note/delete/83279/useless
Del: bad code -- https://master.php.net/note/delete/83279/bad+code
Del: spam -- https://master.php.net/note/delete/83279/spam
Del: non-english -- https://master.php.net/note/delete/83279/non-english
Del: in docs -- https://master.php.net/note/delete/83279/in+docs
Del: other reasons-- https://master.php.net/note/delete/83279
Reject -- https://master.php.net/note/reject/83279
Search -- https://master.php.net/manage/user-notes.php