SitePoint Sponsor |
|
User Tag List
Results 1 to 7 of 7
-
Apr 17, 2008, 21:37 #1
- Join Date
- Aug 2004
- Location
- Canada
- Posts
- 730
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Why doesn't fetch_array work on a remote server?
It works on a local server but not on a remote.
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in e:\vhosts\...\files\getTableContents.php on line 15Compare bible texts (and other tools):
TheWheelofGod
-
Apr 17, 2008, 21:39 #2
It tells you, supplied argument is not a valid MySQL result resource.
-
Apr 17, 2008, 21:40 #3
- Join Date
- Aug 2004
- Location
- Canada
- Posts
- 730
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Compare bible texts (and other tools):
TheWheelofGod
-
Apr 17, 2008, 21:43 #4
Check mysql_query make sure it has not errored out, as well as mysql_connect.
-
Apr 17, 2008, 23:13 #5
- Join Date
- Oct 2006
- Location
- Queensland, Australia
- Posts
- 852
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Correct your database details, then it will work!
-
Apr 18, 2008, 01:21 #6
- Join Date
- Oct 2006
- Location
- France, deep rural.
- Posts
- 6,869
- Mentioned
- 17 Post(s)
- Tagged
- 1 Thread(s)
If you cannot get a hold of mysql_errno() or similar then echo your sql statement to the screen, copy it, paste it into PhpMyAdmin and make sure it is valid - this is usually the problem when I see that error. Something somewhere is not adding the expected variable into your sql statement.
temporarily open up:
e:\vhosts\...\files\getTableContents.php
-
Apr 18, 2008, 07:00 #7
- Join Date
- Nov 2004
- Location
- Lincoln Nebraska
- Posts
- 1,161
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
If there is any difference between the database on the remote and the one on your local machine, it could be causing the query to fail. A common problem I see with scripts using MySQL is that proper checking isn't done from end to end, to ensure that everything worked. All of the MySQL functions return a value that evaluates to false if there is a problem. From the time you connect till the time that the connection is closed, there are any number of things that can go wrong.
You would never get that error if you had evaluated what mysql_query returned first before trying to get a result set, that doesn't exist.
Bookmarks