From: Roland Häder Date: Sat, 6 Sep 2008 20:48:57 +0000 (+0000) Subject: Fix for PHP error X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=b17c72e5a671033c7079e43f28a43537e9f16ccf;p=mailer.git Fix for PHP error --- diff --git a/inc/libs/surfbar_functions.php b/inc/libs/surfbar_functions.php index 1c676079a1..898b2a5d64 100644 --- a/inc/libs/surfbar_functions.php +++ b/inc/libs/surfbar_functions.php @@ -453,6 +453,12 @@ ORDER BY // Free result SQL_FREERESULT($result); + // Shall we add some ids? + $ADD = ""; + if (count($USE) > 0) { + $ADD = " AND l.id IN (".implode(",", $USE).")"; + } // END - if + // And query the database //* DEBUG: */ echo __FUNCTION__.":randNum={$randNum},maxRand={$maxRand},surfLock=".SURFBAR_GET_DATA('surf_lock')."
\n"; $result = SQL_QUERY_ESC("SELECT sbu.id, sbu.userid, sbu.url, sbs.last_salt, sbu.reward, sbu.costs, sbu.views_total, p.time, UNIX_TIMESTAMP(l.last_surfed) AS last_surfed @@ -463,7 +469,7 @@ LEFT JOIN "._MYSQL_PREFIX."_surfbar_salts AS sbs ON sbu.id=sbs.url_id LEFT JOIN "._MYSQL_PREFIX."_surfbar_locks AS l ON sbu.id=l.url_id -WHERE sbu.userid != %s AND sbu.status='CONFIRMED' AND l.id IN (".implode(",", $USE).") +WHERE sbu.userid != %s AND sbu.status='CONFIRMED'".$ADD." GROUP BY sbu.id ORDER BY l.last_surfed ASC, sbu.id ASC LIMIT %s,1",