Forgot table_prefix in the logs table migrator
authorDan
Fri, 18 Dec 2009 21:04:39 -0500
changeset 1181 91911e183685
parent 1180 4829d15d2782
child 1182 58af2268331b
Forgot table_prefix in the logs table migrator
install/schemas/upgrade/1.1.6-1.1.7.php
--- a/install/schemas/upgrade/1.1.6-1.1.7.php	Fri Dec 18 21:01:09 2009 -0500
+++ b/install/schemas/upgrade/1.1.6-1.1.7.php	Fri Dec 18 21:04:39 2009 -0500
@@ -4,7 +4,7 @@
 
 global $db, $session, $paths, $template, $plugins; // Common objects
 
-$q = $db->sql_query('SELECT user_id, username FROM users;');
+$q = $db->sql_query('SELECT user_id, username FROM ' . table_prefix . 'users;');
 if ( !$q )
   $db->_die();
 
@@ -15,7 +15,7 @@
 }
 $db->free_result();
 
-$q = $db->sql_query('SELECT author FROM logs WHERE author_uid = 1;');
+$q = $db->sql_query('SELECT author FROM ' . table_prefix . 'logs WHERE author_uid = 1;');
 if ( !$q )
   $db->_die();
 
@@ -26,7 +26,7 @@
   if ( isset($map[ $row['author'] ]) && !is_valid_ip($row['author']) && !in_array($row['author'], $updated) )
   {
     $author = $db->escape($row['author']);
-    $sql = "UPDATE logs SET author_uid = {$map[ $row['author'] ]} WHERE author = '$author';";
+    $sql = "UPDATE " . table_prefix . "logs SET author_uid = {$map[ $row['author'] ]} WHERE author = '$author';";
     if ( !$db->sql_query($sql) )
       $db->_die();
     $updated[] = $row['author'];