I have a database with the folliwng example data
http://i.stack.imgur.com/YOmX9.png
I am using PDO to search the names (the 3rd column, I sort of excluded the titles) using the following:
search('items', 'name', 'Strong');
public function search($table, $column, $term){
$command = "SELECT name FROM `$table` WHERE `$column` LIKE :$column";
$query = $this->connection->prepare($command);
$query->execute(array(":$column"=>$term));
return $query->fetchAll();
}
and my reutrn is
Array ( )
Why is it not returning anything?
See Question&Answers more detail:os