mysql - Drupal 7 PDOException: SQLState[42S22], unknown field -
i don't know start error:
pdoexception: sqlstate[42s22]: column not found: 1054 unknown column 'created' in 'field list': select created {counter} created<>0 order created desc limit 1; array ( ) in counter_block_view() (line 143 /customers/6/8/3/lmtc.be/httpd.www/drupal/sites/all/modules/counter/counter.module).
the error happens on login!
the file counter.module looks this:
127 // counter_insert_delay 128 $db_types = db_driver(); 129 switch ($db_types) { 130 case 'mssql': 131 $sql = " select top 1 created {counter} created<>0 order created desc"; 132 break; 133 134 case 'oracle': 135 $sql = " select created {counter} rownum=1 , created<>0 order created desc"; 136 break; 137 138 // mysql, mysqli, pgsql. 139 default: 140 $sql = " select created {counter} created<>0 order created desc limit 1"; 141 } 142 143 $counter_lastdate = db_query($sql)->fetchfield();
my database looks this:
22901 -- 22902 -- table structure table `counter` 22903 -- 22904 22905 create table if not exists `counter` ( 22906 `counter_id` int(11) not null auto_increment, 22907 `counter_ip` varchar(32) not null default '', 22908 `counter_date` varchar(32) not null default '', 22909 `counter_page` varchar(255) not null default '0', 22910 primary key (`counter_id`), 22911 key `counter_date` (`counter_date`), 22912 key `counter_ip` (`counter_ip`) 22913) engine=myisam default charset=utf8 auto_increment=217 ;
conclusion: there indeed no column 'created' in mysql database. last thing changed @ site 2 articles few months ago. last change structure long time ago, , site counter has never been changed since setup of site.
what can able login again? shall delete counter module?
ps i'm not drupal developer.
i'll thank in advance help.
kind greetings, frank
may have updated modules forgot run database updates? try go your_site/update.php page , follow instructions.
and of course have log in administrator before that.
Comments
Post a Comment