History: Fixed missing $q in fetchrow()
authorDan
Mon, 06 Jul 2009 11:27:02 -0400
changeset 1037 61354f877e06
parent 1036 589e6e7e5243
child 1038 6a04793ae13c
History: Fixed missing $q in fetchrow()
includes/pageutils.php
--- a/includes/pageutils.php	Mon Jul 06 11:26:42 2009 -0400
+++ b/includes/pageutils.php	Mon Jul 06 11:27:02 2009 -0400
@@ -378,8 +378,8 @@
     }
     $db->free_result();
     echo '<h3>' . $lang->get('history_heading_other') . '</h3>';
-    $q = 'SELECT log_id,time_id,action,date_string,page_id,namespace,author,edit_summary,minor_edit FROM ' . table_prefix.'logs WHERE log_type=\'page\' AND action!=\'edit\' AND page_id=\'' . $paths->page_id . '\' AND namespace=\'' . $paths->namespace . '\' ORDER BY time_id DESC;';
-    if ( !$db->sql_query($q) )
+    $sql = 'SELECT log_id,time_id,action,date_string,page_id,namespace,author,edit_summary,minor_edit FROM ' . table_prefix.'logs WHERE log_type=\'page\' AND action!=\'edit\' AND page_id=\'' . $paths->page_id . '\' AND namespace=\'' . $paths->namespace . '\' ORDER BY time_id DESC;';
+    if ( !( $q = $db->sql_query($sql)) )
     {
       $db->_die('The history data for the page "' . htmlspecialchars($paths->cpage['name']) . '" could not be selected.');
     }
@@ -400,7 +400,7 @@
                 <th colspan="2"></th>
               </tr>';
       $cls = 'row2';
-      while($r = $db->fetchrow()) {
+      while($r = $db->fetchrow($q)) {
         
         if($cls == 'row2') $cls = 'row1';
         else $cls = 'row2';