0

Can anyone help me figure out how to fix these errors?

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);

4
Contributors
5
Replies
27
Views
3 Years
Discussion Span
Last Post by Lsmjudoka
0

You have a error in your mysql_connect stament.
make sure you have the right host, user, and password

0

Change this
mysql_select_db($conn, "yourmil_content");

To this
mysql_select_db("yourmil_content", $conn);

0

Pixelsoul, I changed that line of code and this is what I see: www.YourMilitary.org

0

Your problem starts from not passing a valid $conn handle to your mysql_select_db function, which then causes your subsequent query to fail. This traces back to your mysql_connect() statement pzuurveen mentioned. It should look something like this:

mysql_connect($host, $user, $password) or die(mysql_error());

This way if there is any error, the script will tell you.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.