Below given is part of code:
$query1 = "SELECT * FROM table4 WHERE dr_id='{$drid}'";
$result1=mysql_query($query1,$con);
$values1= mysql_fetch_array($result1);
echo "<br>".$values1['mor_max'];
$i=$values1['mor_max'];
$i--;
echo "<br>".$i;
$query2="UPDATE table4 SET mor_max= $i WHERE dr_id='{drid}'";
$result2=mysql_query($query2,$con);
$values2= mysql_fetch_array($result2);
echo "<br>".$values2['mor_max'];
Using $i in update query gives no error. Is that ok ? I am a newbie in php so please help. Also warning I am getting is "mysql_fetch_array() expects parameter 1 to be resource, boolean given". Please suggest more efficient way of doing the same.