Reputation: 119
I have table with colums id, name, email, message, phone, links and login. Login can be null(empty).
Its my sql request:
$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);
whith this error
Call to a member function setFetchMode() on a non-object
Its error with "WHERE login NOT NULL", i know. How me correctly make this request?
Upvotes: 3
Views: 119
Reputation: 60493
missing an IS
SELECT * FROM `form` WHERE login IS NOT NULL
Upvotes: 10