Jump to content

Php4 to Php5 errors


NancyBrown

Recommended Posts

I am moving my website written in php 4 to a server that has php5. Here are the 3 warnings I have received. How do I fix this?

 

Warning: mysql select db(): supplied argument is not a valid MySQL-Link resource in /home/xxxxx /index.php on line 37

 

Line 37 is:

mysql_select_db($conn, "yourmil_content");

-----------------------------------------------------------------------------

Warning: mysql_query(): supplied argument is not a valid MySQL-Link resource in/home/xxxxxx/index.php on line 247

 

Line 247 is:

$result = mysql_query($sql, $conn);

---------------------------------------------------------------------------------------------------

Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in/home/xxxxx/index.php on line 248

 

Line 248 is:

 $data = mysql_fetch_array($result);

 

Link to comment
https://forums.phpfreaks.com/topic/284172-php4-to-php5-errors/
Share on other sites

WOW, how did that work in PHP4 !!

Line 37 is:
mysql_select_db($conn, "yourmil_content");

The first parameter you set is the connection resource, but thats wrong, it should be (see the documentation for mysql_select_db()):

Line 37 is:
mysql_select_db("yourmil_content", $conn);

And this error :

Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in/home/xxxxx/index.php on line 248
 
Line 248 is:
 $data = mysql_fetch_array($result);

is actually a result of this error :

Warning: mysql_query(): supplied argument is not a valid MySQL-Link resource in/home/xxxxxx/index.php on line 247
 
Line 247 is:
$result = mysql_query($sql, $conn);

I would suggest to you to review your connection parameters again.

Link to comment
https://forums.phpfreaks.com/topic/284172-php4-to-php5-errors/#findComment-1459556
Share on other sites

I have no knowledge of PHP other than I know how to change the password to the database and database name in the index.php file. With that said, can you give me easy instructions on how to fix this? Thanks to the 2 replies I have received but I don't know how to do what they are suggesting. 

 

 

Link to comment
https://forums.phpfreaks.com/topic/284172-php4-to-php5-errors/#findComment-1459564
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.