My question is simple but i didn't find any question or answer for this.I mean they are not solution for my case. Here is the my code.
$characters = $_GET["search"];
$characters2 = "%". $characters . "%" ;
$statement = $connection->prepare(
"SELECT name,username FROM users WHERE 'name' LIKE :username or 'username' LIKE :username");
$statement->bindParam(':username', $characters2, PDO::PARAM_STR);
$statement->execute();
Problem is if you have david in the name column in the database and your $_GET["search"] is "davi" or "david" it couldn't find the david's row.
Returns empty.