I replaced the query with what you had:
<?php
$dbhost = 'localhost';
$dbuser = ' ';
$dbpass = ; ';
$conn = mysql_connect($dbhost, $dbuser, $dbpass) or die ('Error connecting to mysql');
$dbname = 'bamabell_menus';
mysql_select_db($dbname);
$sql = "SELECT dessert1, dessert2, dessert3, dessert4
FROM desserts_of_the_day
INNER JOIN week_day ON desserts_of_the_day.week_day = week_day.ID
WHERE week_day._day = 'Monday'";
$result = mysql_query($sql);
if (!$result) {
echo "Could not successfully run query ($sql) from DB: " . mysql_error();
exit;
}
if (mysql_num_rows($result) == 0) {
echo "No rows found, nothing to print so am exiting";
exit;
}
while ($row = mysql_fetch_assoc($result)) {
echo $row["week_day.Monday"];
}
mysql_free_result($result);
while($row = mysql_fetch_assoc($result)){
echo "dessert1:".$row['dessert1'].", dessert2:".$row['dessert2']
.", dessert3:".$row['dessert3'].", dessert4:".$row['dessert4']."<br/>";
}
?>
now I get this error:
Warning: mysql_fetch_assoc(): 3 is not a valid MySQL result resource in /home/bamabell/public_html/dessert_of_the_day.php on line 33
line 33 is in red ... and I thought doing the database was the hard part!