I'm new to PHP programming. I want to execute 2 queries at the same PHP code. The first query gave me expected results. But the second query seems to be not working. But it does not show me any error message. Can someone help me?
<?php
mysql_connect('localhost','root','');
mysql_select_db('health');
$query1="SELECT * FROM messages,doctor WHERE doctor.regNo=messages.regNo AND messages.ID='".$id."';";
$result1=mysql_query($query1) or die(mysql_error());
$row=mysql_fetch_array($result1);
echo '<table cellspacing="10">';
echo '<tr><td><b>From: </b></td><td>Dr. '.$row['firstName'].' '.$row['lastName'].'</td></tr>';
echo '<tr><td><b>Category: </b></td><td>'.$row['category'].'</td></tr>';
echo '</table>';
echo '<p style="padding-left:13px;">'.$row['reply'].'</p>';
echo '</br><b style="padding-left:13px;">Your question</b></br>';
echo '<p style="padding-left:13px;">'.$row['question'].'</p>';
$query2="UPDATE health.messages SET read='Y' WHERE messages.ID='".$id."';";
$result2=mysql_query($query2);
mysql_close();
?>