pouncer Posted April 9, 2009 Share Posted April 9, 2009 /* * Check if an RSS Feed link already exists in the database. */ function rssExists($link, $rss_table) { $check_link = mysql_query("SELECT * FROM `$rss_table` where rsslink='$link'") or die("Query error: <b>". mysql_error()); $rows = mysql_num_rows($check_link); if ($rows == 1) return true; else return false; } Is it possible to do it without using a query? Quote Link to comment Share on other sites More sharing options...
redarrow Posted April 9, 2009 Share Posted April 9, 2009 what you mean if it info in the database then you need a query ha Quote Link to comment Share on other sites More sharing options...
pouncer Posted April 9, 2009 Author Share Posted April 9, 2009 just trying to make the code smaller i guess Quote Link to comment Share on other sites More sharing options...
redarrow Posted April 9, 2009 Share Posted April 9, 2009 what about this. added limit 1, might work. <?php /* * Check if an RSS Feed link already exists in the database. */ function rssExists($link, $rss_table) { $check_link = mysql_query("SELECT * FROM `$rss_table` where rsslink='$link' LIMIT 1") or die("Query error: <b>". mysql_error()); if(mysql_num_rows($check_link)){ return true; }else{ return false; } } ?> Quote Link to comment 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.