I am banging my head into the keyboard about now. My ISP switched servers this week, and switched my mySQL db also.
PHP4.2.2 & mySQL 3.23.45
Up until now I have written PHP3.. now I am thrust into 4, and dunno if this is where the problem is:
I have a PHP page that connects to mySQL db. That is working, and I can also access db via command line and edit, etc.. so db is fine. I accessed db via myPHPadmin vs 2.2 also, no prob. All data is intact.
My code, written in PHP3, which worked fine until the server switch, now throws this error:
Warning: mysql_fetch_object(): supplied argument is not a valid MySQL result resource in /home/viol8ion/public_html/rant.php3 on line 43
Here is the hook to the mySQL db with private info changed, of course:
<?php
$sql = "SELECT * FROM rantitems";
$dbh=mysql_connect ("localhost", "me", "my_password" or die ('I
cannot connect to the database.');
mysql_select_db ("my_database"
$rs = mysql_db_query("my_database",$sql);
?>
Here is line 43:
while ($row = mysql_fetch_object($rs)) {
here is the page in question:
I know the answer is staring me in the face but it has been a long freaking weekend, and a long day... any ideas, anyone? Thanx When in doubt, deny all terms and defnitions.
PHP4.2.2 & mySQL 3.23.45
Up until now I have written PHP3.. now I am thrust into 4, and dunno if this is where the problem is:
I have a PHP page that connects to mySQL db. That is working, and I can also access db via command line and edit, etc.. so db is fine. I accessed db via myPHPadmin vs 2.2 also, no prob. All data is intact.
My code, written in PHP3, which worked fine until the server switch, now throws this error:
Warning: mysql_fetch_object(): supplied argument is not a valid MySQL result resource in /home/viol8ion/public_html/rant.php3 on line 43
Here is the hook to the mySQL db with private info changed, of course:
<?php
$sql = "SELECT * FROM rantitems";
$dbh=mysql_connect ("localhost", "me", "my_password" or die ('I
cannot connect to the database.');
mysql_select_db ("my_database"
$rs = mysql_db_query("my_database",$sql);
?>
Here is line 43:
while ($row = mysql_fetch_object($rs)) {
here is the page in question:
I know the answer is staring me in the face but it has been a long freaking weekend, and a long day... any ideas, anyone? Thanx When in doubt, deny all terms and defnitions.