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.
31k questions
32.8k answers
501 comments
693 users