[Comoblog-commit] modules/mod_fortune_db/include mod_fortune_db.inc.php,1.1,1.2
Status: Inactive
Brought to you by:
markwallis
|
From: iamdecal <iam...@us...> - 2006-02-02 10:37:59
|
Update of /cvsroot/comoblog/modules/mod_fortune_db/include In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8457/modules/mod_fortune_db/include Modified Files: mod_fortune_db.inc.php Log Message: seems to be a problem with the mysql conection - the error log shows one row is found - as it should be, but i cant loop the results set. this works fine in mod_randomthumb, so i'm guessing its a type somewhere.. but i cant see where its coming from. TO DO need to add functions to edit the fortunes -ala mod_blogrolling. Index: mod_fortune_db.inc.php =================================================================== RCS file: /cvsroot/comoblog/modules/mod_fortune_db/include/mod_fortune_db.inc.php,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- mod_fortune_db.inc.php 1 Feb 2006 17:28:59 -0000 1.1 +++ mod_fortune_db.inc.php 2 Feb 2006 10:37:50 -0000 1.2 @@ -2,39 +2,19 @@ function mod_fortune_db() { - if (CFG_USE_PATH_INFO == 'no') - $iisbug = '?'; - else - $iisbug = ''; - - - $query = " - select - * - from - ".CFG_MYSQL_TABPREFIX."mod_fortune_db - order by rand() - limit 1 "; + $query = "select fortune_db_id, fortune_db_content from ".CFG_MYSQL_TABPREFIX."mod_fortune_db order by rand() limit 1 "; $res = mysql_query($query); - if (!$res || !mysql_num_rows($res)){ - echo "<hr>\n" . mysql_errno() . ": " . mysql_error(). ":" . mysql_num_rows($res) . ":" .$query . "<hr>\n"; - - exit; - return (false); - } + $error= "error no " . mysql_errno() . " : error " . mysql_error(). " : rows" . mysql_num_rows($res) . ": query " .$query ; + error_log($error,0); $items = array(); while ($row = mysql_fetch_assoc($res)) { $query = "update ".CFG_MYSQL_TABPREFIX."mod_fortune_db set fortune_db_display_count = (fortune_db_display_count +1) where fortune_db_id =". addslashes( $row['fortune_db_id']).";" ; $res = mysql_query($query); - #if (!$res || !mysql_num_rows($res)){ - # echo "<hr>\n" . mysql_errno() . ": " . mysql_error(). ":" . mysql_num_rows($res) . ":" .$query . "<hr>\n"; - #} $row['mod_fortune_db_title'] = CFG_MOD_FORTUNE_DB_TITLE; - $items[] = $row; } return ($items); } -?> \ No newline at end of file +?> |