O'Reilly logo
  • Juan Jose Vazquez thinks this is interesting:

$query = "SELECT ISBN, Author, Title, Price
              FROM Books WHERE $searchtype = ?";

From

Cover of PHP and MySQL® Web Development, Fifth Edition

Note

This is wrong. the correct expression is:

$query = "SELECT ISBN, Author, Title, Price FROM books WHERE ".$searchtype."=?";