spiderdog Posted June 13, 2007 Share Posted June 13, 2007 is it possible to check existence for a mysql row? Quote Link to comment https://forums.phpfreaks.com/topic/55414-is-it-possible-to-check-existence-for-a-mysql-row/ Share on other sites More sharing options...
trq Posted June 13, 2007 Share Posted June 13, 2007 Yep. <?php if $result = mysql_query("SELECT row FROM foo WHERE id = 2")) { if (mysql_num_rows($result)) { // row exists } else { // row does not exist. } } ?> Quote Link to comment https://forums.phpfreaks.com/topic/55414-is-it-possible-to-check-existence-for-a-mysql-row/#findComment-273881 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.