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

Recommended Answers

All 5 Replies

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

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

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

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

I'm not seeing a problem, can you tell me where the problem is?

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.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.