Jump to content

Php4 to Php5 errors


Go to solution Solved by Ch0cu3r,

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.

Edited by JIXO
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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.