I have this code
$query_search = $this->db->prepare("SELECT* FROM table1 LEFT JOIN table2 ON (table1.id=table2.id) WHERE table1.nome LIKE ? ORDER BY ? DESC");
if($query_search->execute(array($cliente_procura."%",'table2.'.$ordem)))
{
//code
}
But I'm having some problems with the ORDER BY
clause.
How can I use PDO and make sure my tables are in the order I want?