David Bruno wrote:
> errors are:
>
> Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result
>
> Warning: mysql_free_result(): supplied argument is not a valid MySQL result
You need to do some diagnostics. I think the problem is most likely to
have occurred before the functions above were called.
1. Find out for sure whether the mysql_query() call is returning true,
false or the resource. If it is false, you have a syntax error in your
PHP or an incorrect sql string.
2. Make sure that the setup of the database is exactly the same. Are you
sure that the username and pass are the same as on the old server, and
that they are correctly typed?
3. Do a PHP_info() to make sure that the version of PHP is the same and
that the server setup is the same in all the relevant areas. Find out if
register_globals is on/off and make sure that if it is off that it
doesn't break your script.
4. If the sql string is dynamically generated, echo the string out after
it is created to make sure that it is correct. You could double check by
copy/pasting it into phpmyadmin or equivalent to make sure that it
doesn't throw any errors. And remember not to use a semicolon in the sql
string.
Failing that, trawl the manual at PHP.net:
<a style='text-decoration: underline;' href="http://au.php.net/manual/en/function.mysql-query.php" target="_blank">http://au.php.net/manual/en/function.mysql-query.php</a>
Faily that, post here with the full code.<!-- ~MESSAGE_AFTER~ -->
>> Stay informed about: mysql errors