$id= ($_POST['queryId']);
$select =mysql_query("SELECT field1,field2,field3,field4 FROM table WHERE id= $id");
$results = mysql_num_rows($select);//mysql_query($select);
if ($results > 0)
{
echo"query already attended";
}
else
{
$id= intval($_POST['queryId']);
$sql="UPDATE tableSET field1='$value',field2='$value',field3='$value',field4='$value',field5='$value',field6='$value',field7='$value' Where queryId= $id";
header('Location:page.html');
}
What is happening is that even when the table had data in those fields it still updates, and what i want it to do is show me the error and not save, but it seems to skip that section and always saves and replaces the data that is there

New Topic/Question
Reply



MultiQuote



|