Jump to content

LIKE , % , < problem


fxuser

Recommended Posts

So i have this simple query running each time i write something in an input text via Ajax:

$query = mysql_query("SELECT names FROM users WHERE names LIKE '$names%'");
while($row = mysql_fetch_assoc($query)){
	echo $row['names'];
}

 

the problem is that i can easily type %,<,^ and whatever else multiple times and then get all the results... which is not what i want... how can i make it so when the user types such symbols not to get anything ?

 

Thanks.

Link to comment
https://forums.phpfreaks.com/topic/227399-like-problem/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.