PHP4 to PHP5 errors

I am moving a website that sits on a server with PHP4 to a server that has PHP5. Here are the 3 errors I am getting on the homepage of my website. Can anyone PLEASE help me fix this??

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

This is line 37:
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
This is line 247:
$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
This is line 248:
$data = mysql_fetch_array($result);

where is your definition of $conn? As that is the problem.

Here is $conn

// Establish a database connection
//$conn = mysql_connect(“localhost”, “username”, “password”);
mysql_select_db(“yourmil_content”, $conn);

Why is the $conn line commented out? Was it not working?

While you’re fixing that code, I suggest you change from deprecated mysql to either mysqli or PDO so you won’t need to fix it again.

What CMS is it using?

Given that the old server was using PHP4, you might seriously want to consider a complete re-write of the code anyway and make use of OOP. Chances are that your code uses functions which will have been deprecated and removed from PHP.