Posted by hope on 10/04/80 11:23
U might try omthing like this::
$query = "SELECT id FROM mytable WHERE bla LIKE " . $x .";
$result = mysql_query($query, $cnn) or die(mysql_error());
$totalRows_result = mysql_num_rows($result);
if($totalRows_result>0)
{
//display error tht id already exists
}
else
{
//insert code goes here
}
[Back to original message]
|