mjrose2003 Posted November 26, 2003 Share Posted November 26, 2003 I used this setup on another server and it worked OK. Now I am forced to move to a new server and the same code returns the error \"Warning: mysql_fetch_row(): supplied argument is not a valid MySQL result resource in /home/homes/public_html/browse.php3 on line 79\" Note - line 79 is >> while ($myrow = mysql_fetch_row($result)) { Here is the code: <?php $db = mysql_connect(\"localhost\", \"homes_Mike\", \"MySQL\"); mysql_select_db(\"homes_homes\",$db); $result = mysql_query(\"SELECT * FROM items2 ORDER BY Price ASC\",$db); echo \"<center><table CELLPADDING=5 border=2 BORDERCOLOR=\'#000099\'> n\"; while ($myrow = mysql_fetch_row($result)) { printf(\"<tr><td><font size=-1>%s</font></td><td><font size=-1>%s</font></td><td><font size=-1>%s</font></td><td><center><font size=-1>%s</font></center></td><td><center><font size=-1>%s</center></td><td><font size=-1>$%s</font></td><td><center><b><font size=-1>%s</font></b></center></td><td><center><font size=-1>%s</font></center></td></tr>n\", $myrow[0], $myrow[1], $myrow[2], $myrow[3], $myrow[4], $myrow[5], $myrow[6], $myrow[7]); } echo \"</table></center>n\"; ?> Any suggestions? I\'m in a bind to get this back up. Quote Link to comment https://forums.phpfreaks.com/topic/1425-moved-to-new-server-now-get-mysql-error/ Share on other sites More sharing options...
Arenium Posted November 26, 2003 Share Posted November 26, 2003 eek! that better not really be your password... Quote Link to comment https://forums.phpfreaks.com/topic/1425-moved-to-new-server-now-get-mysql-error/#findComment-4716 Share on other sites More sharing options...
mjrose2003 Posted November 26, 2003 Author Share Posted November 26, 2003 Actually, it\'s not the pw. But, since I didn\'t post the domain name... Quote Link to comment https://forums.phpfreaks.com/topic/1425-moved-to-new-server-now-get-mysql-error/#findComment-4719 Share on other sites More sharing options...
mre2mpo Posted December 3, 2003 Share Posted December 3, 2003 Are you sure the mysql servername is localhost and the username, password and database name are correct. Your sql dose not look like its wrong unless you don\'t have that table or field. Are you trying to connect from a different webserver to the same mysql server if so it will not be localhost (or the new server might not be localhost) my hosting company uses it servers IP address (not localhost) Quote Link to comment https://forums.phpfreaks.com/topic/1425-moved-to-new-server-now-get-mysql-error/#findComment-4803 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.