From: Will Budicm Date: Fri, 1 Jan 2021 16:07:11 +0000 (+1100) Subject: Can't shortcut statments when dealing with DB. X-Git-Url: https://lifelog.hopto.org/gitweb/?a=commitdiff_plain;h=ca66f94c64d504ce1ca57a54899a00bb0ea16f1d;p=LifeLog.git Can't shortcut statments when dealing with DB. --- diff --git a/htdocs/cgi-bin/login_ctr.cgi b/htdocs/cgi-bin/login_ctr.cgi index 90717ab..c92715e 100755 --- a/htdocs/cgi-bin/login_ctr.cgi +++ b/htdocs/cgi-bin/login_ctr.cgi @@ -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.