I'm trying to write a simple method to sort some DB results. We are stuck using PEAR DB, which is an old OO data object class.
I need to dynamically set which column we sort by:
$query = $db->prepare('SELECT * FROM ' . $this->table . ' WHERE ? IS NOT NULL');
The problem occurs because when the statement is executed, I wind up with the column name in regular quotes instead of slanted ones, so in the example, the column is never NULL.