简体   繁体   中英

SQL problem Unknown column 'approved' in 'where clause' [on hold]

im beginner i cant find a solution with that message when i use debug mod on my script

Unknown column 'approved' in 'where clause' | QUERY: SELECT COUNT(`record_num`) AS `count` FROM `scraper_import` WHERE `approved` = 1

my scraper.php

$i = trim($i);
if (dbQuery("INSERT INTO scraper_import (url, user, paysite) VALUES ('$i','$_POST[submitter]', '$_POST[paysite]')")) {
   $counter++;
 } else {
   $errors++;
 }
            }
        }
    }

I need create column approved

I need create column approved

In PHPMyAdmin You can add something like the following:

ALTER TABLE `scaper_import` ADD COLUMN `approved` TINYINT(1) NOT NULL DEFAULT 0;

That should add the column you desire.

I found a solution, I add on my sql file column approved and data and now it works. Thanks for helping me.

This is the solution:

CREATE TABLE IF NOT EXISTS `scraper_import` (
  `url` varchar(255) NOT NULL,
  `user` int(11) NOT NULL,
  `paysite` int(11) NOT NULL,
  `data` text NOT NULL,
  `approved` TINYINT(1) NOT NULL DEFAULT 0,
  `record_num` int(11) NOT NULL AUTO_INCREMENT,
  PRIMARY KEY (`record_num`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ;

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM