I'm getting the following error :
Warning : mysql_fetch_array() expects parameter 1 to be resource, boolean given in
and
Warning: Cannot modify header information - headers already sent by (output started at "Insert file location here" in "Insert File location here"on line
Here's my code
<?php
if (isset($_GET['id']))
{
$con = mysql_connect("xxx.net","username","password") or die("Connection to server Failed");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db("itekniks_altaroca") or die("DB Selection Failed");
$messages_id = $_GET['id'];
$result3 = mysql_query("SELECT * FROM reservation where reservation_id ='$messages_id'");
while($row3 = mysql_fetch_array($result3))
{
$res=$row3['confirmation'];
}
$update1=mysql_query("UPDATE reservation SET status ='out' WHERE reservation_id ='$messages_id'");
$update2=mysql_query("UPDATE roominventory SET status ='out' WHERE confirmation = '$res'");
header("location: home_admin.php#1");
exit();
mysql_close($con);
}
?>