spiderdog Posted June 13, 2007 Share Posted June 13, 2007 is it possible to check existence for a mysql row? 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. } } ?> 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
Archived
This topic is now archived and is closed to further replies.