PHP/MYSQL issue - query search failing randomly -
i have php script designed scrape data websites. script checks locally-hosted mysql database each time finds new item see whether or not item has been downloaded , exists in mysql database. if sees item exists in database, should ignore , move on. code using that:
$result = mysql_query("select * web_media sourceforum '%$forumtograb%' , titlethreadnum=$threadtitleexists"); if((!mysql_num_rows($result)) && (mysql_num_rows($result) !== false)) {}
in other words, if comes 0 results, item considered new. script ran fine on old hosting company several months. have moved new hosting provider, , i'm running strange issue. every 12 hours or so, expression seems randomly fail , script finds bunch of "new" data exists in mysql database. i've tried running query manually, , code appears have no problem finding pre-existing entry no problem.
does have idea what's going on here? checked hosting provider, , number of aborted mysql connections have low , isn't worry about…so doesn't seem it's issue mysql itself. suspect may issue mysql query?
thanks
try check mysql error log errors in query. ps: hope preparing $threadtitleexists usage in mysql query (smth (int)$threadtitleexists or mysqli_real_escape_string($threadtitleexists))
Comments
Post a Comment