]> lifelog.hopto.org Git - LifeLog.git/commitdiff
Can't shortcut statments when dealing with DB.
authorWill Budicm <redacted>
Fri, 1 Jan 2021 16:07:11 +0000 (03:07 +1100)
committerWill Budicm <redacted>
Fri, 1 Jan 2021 16:07:11 +0000 (03:07 +1100)
htdocs/cgi-bin/login_ctr.cgi

index 90717ab2b4e73208ec35591fb79394bd501c2583..c92715e9a4b2214437cbcae4f255b489592d8fe4 100755 (executable)
@@ -295,10 +295,11 @@ try{
     }
     #Is it pre or around v.2.1, where ID_RTF is instead of RTF in the LOG table?
     if($hasLogTbl && !Settings::isProgressDB()){ 
-        $pst = Settings::selectRecords($db, "SELECT * from pragma_table_info('LOG') where name like 'ID_RTF'");        
-        if($pst->fetchrow_array()){
-            $db->do("ALTER TABLE LOG RENAME COLUMN ID_RTF TO RTF");
-        }
+        $pst = Settings::selectRecords($db, "SELECT * from pragma_table_info('LOG') where name like 'ID_RTF';");
+        my @row = $pst = $pst->fetchrow_array();  
+        if(scalar (@row)>0){
+            $db->do("ALTER TABLE LOG RENAME COLUMN ID_RTF TO RTF;");           
+        }        
     }
     #
     # From v.1.8 Log has changed, to have LOG to NOTES relation.