Sql query "not null"
I have a table with colums ids, name, email, message, phone, links and login. The input can be empty (empty).
Its sql query:
$dbh = new PDO("mysql:host=$dbHost;dbname=$dbName", $dbUser, $dbPassword);
$sth = $dbh->query('SELECT * FROM `form` WHERE login NOT NULL ');
$sth->setFetchMode(PDO::FETCH_ASSOC);
with this error
Call to a member function setFetchMode() on a non-object
Its an error with "WHERE login NOT NULL" I know. How am I doing this request correctly?
+3
source to share
3 answers