I have the following query:
//query: $query = " SELECT field1 FROM table WHERE field2 = :PARAM1 AND ... AND fieldx = :PARAM1X"; //params: $params = array(); $params [":PARAM" . $i] = NULL; //prepare and execute: $o = $cnx->prepare($query); $o->execute($params);
How can I bind parameters with NULL values? Will PDO automatically change = :PARAM1 to IS NULL ? To be clear, trying to compute WHERE field = null does not work in mysql and will never return anything. Instead, we should use WHERE field IS NULL .
What I'm dealing with right now.
I have to say that my first tests are positive, but I really do not want to detect a side effect after 6 months in the production environment ...
source share