Back
You can use the following code:
$key_id = 123; $result = mysql_query("SELECT * FROM table WHERE key_id='$key_id'"); $num_rows = mysql_num_rows($result); if ($num_rows) { trigger_error('It exists.', E_USER_WARNING); }
Want to learn more concepts related to SQL? Join this SQL Course by Intellipaat.
30.9k questions
32.9k answers
500 comments
665 users