PHP: the usage of "%" in a mysql_query

Status
Not open for further replies.

uguxseo

Shock Marketer
Mar 10, 2008
226
1
0
shockmarketer.com
Alright, I'm not very good with PHP. Could anyone tell what the usage of "%" serves in a mysql_query, such as:

$query = mysql_query("SELECT * FROM dictionary_list WHERE word LIKE '$q%' LIMIT $limit") or die(mysql_error());

PS: This is a dictionary lookup. Say you put in "a", it will spit out:
A:
Aëneous:
Aërate:
Aëration:
Aërator:
 


% is a wildcard.

In your example, it would return any records where the `word` starts with q.
 
  • Like
Reactions: uguxseo
Status
Not open for further replies.