Re: PHP4 and mysql_fetch_array() - one more try
| From: | Robert Vetter | Date: | Thu, 02 Nov 2000 14:23:40 +0000 |
| Subject: | Re: PHP4 and mysql_fetch_array() - one more try | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-4133@lists.php.net to get a copy of this message | ||
Phil Driscoll wrote:
>
> >Well, I can't quite understand this, because it is not an error if a
> >SELECT query returns no rows! An error is, for example, if there would
> >be a syntax error in SQL statement, or a query on a non-existing table,
> >or something like this. I think PHP developers should have a look at
> >this issue...
>
> Robert
>
> Please re-read the email I sent to you and the list yesterday.
> Your mysql_db_query is returning 0, meaning that some kind of error occurred
> (NOT that no rows were returned!).
> mysql_error() will probably tell you what the error was.
> You cannot safely use the return from mysql_db_query (or indeed many other
> functions) without first checking that it did not return an error.
Phil,
sorry, I can't agree.
The code example from my first email works fine with PHP3. I have plenty
of scripts, which use that code scheme, that run with PHP3 without any
problems. After I had upgraded my Apache server to PHP4 in my testing
environtment I got those warning messages. For me it means that there
are some compatibility problems between PHP3 and PHP4.
Robert