I am new to PDO, and I was wondering if there was an equivalent to the mysql statement that checks if a parameter is non-zero, like this:
SELECT * FROM table
WHERE param IS NOT NULL
I tried this:
$pdo->prepare('SELECT * FROM ' . $tablename . ' WHERE ' . $field . ' = :' . $field . 'AND param IS NOT NULL');
without any success. I also looked on the Internet, but did not find anything suitable, can anyone help?
source
share