I have two files this is the file included:
<?php
if (@mysql_connect("localhost","****", "**************") || @mysql_select_db("a_database")) {
echo "Connected";
} else {
die("Not connected.");
}
?>
Then this is the main file:
<?php
require "connect.inc.php";
$query = "SELECT `food`, `calories` FROM `food` ORDER BY `id`";
if ($query_run = mysql_query($query)) {
echo "Success.";
} else {
echo "Query Failed.";
}
?>
However when the page loads it says "ConnectedQuery Failed."
Why could this be?