I am trying to execute a SQL query that will give me all usernames from my table which begin with 'Ana%'.
There are two rows like it:
- Ana
- Anastacia
My code is like:
$value="Ana"
$sql=mysql_query("Select username from users where username like {"."'".$value."%"."'}");
$row=mysql_fetch_array($sql);
print_r($row);
The problem is I get information only about user Ana, not Ana and Anastasia like it should be.
I tried without brackets {}
, but it did not work.