Flying Mullet
02-01-2006, 02:41 PM
Okay, so I have my website running locally on MySQL and PHP (MySQL version 4.1.12a and PHP version 5.0.4) and everything runs just fine. I just uploaded some new code to the server, which is running MySQL version 4.0.25-standard and PHP version 4.3.10, and my code dies with the following error message:
<i>mysql_fetch_array(): supplied argument is not a valid MySQL result resource in xxxx.php on line 20</i>
Here's the code that I'm using:
<i><font size="1">// set up the database connection
$<i></i>db = my<i></i>sql_connect("localhost", "username", "password") or die ('I cannot connect to the database because: ' . mysql_error());;
mysql_se<i></i>lect_db("databasename",$d<i></i>b);
// query the DB for all characterspells
$s<i></i>ql = "SELECT `Level`, `Name`, `Description` FROM `characterspell`, `spell` WHERE `Character` = 'Celes' and `SpellName` = `Name` ORDER BY `Level` ";
$res<i></i>ult = mys<i></i>ql_query($s<i></i>ql);
// print the database results
wh<i></i>ile ($my<i></i>row = my<i></i>sql_fetch_array($re<i></i>sult))...</i></font>
I've checked the documentation for the methods that I'm using and all have been available since PHP version 3 so I would assum eit's not an issue of different versions of PHP. Any ideas?
<i>mysql_fetch_array(): supplied argument is not a valid MySQL result resource in xxxx.php on line 20</i>
Here's the code that I'm using:
<i><font size="1">// set up the database connection
$<i></i>db = my<i></i>sql_connect("localhost", "username", "password") or die ('I cannot connect to the database because: ' . mysql_error());;
mysql_se<i></i>lect_db("databasename",$d<i></i>b);
// query the DB for all characterspells
$s<i></i>ql = "SELECT `Level`, `Name`, `Description` FROM `characterspell`, `spell` WHERE `Character` = 'Celes' and `SpellName` = `Name` ORDER BY `Level` ";
$res<i></i>ult = mys<i></i>ql_query($s<i></i>ql);
// print the database results
wh<i></i>ile ($my<i></i>row = my<i></i>sql_fetch_array($re<i></i>sult))...</i></font>
I've checked the documentation for the methods that I'm using and all have been available since PHP version 3 so I would assum eit's not an issue of different versions of PHP. Any ideas?