+ 1

What does % stand for in the following scenario?

I have a php script that’s job is to edit a database entry. Within the code a variable is defined as follows- $client= "%".$webdata['searchcolumnclient']."%"; $webdata is an array. Why is there a modulo being concatenated on either side? I understand this might not be enough information, if not please let me know and I’ll try explain further but I’d really appreciate no snide remarks. Thanks :)

17th Feb 2020, 10:09 PM
liarra
liarra - avatar
3 Answers
+ 2
This looks like a database query with LIKE operator.
17th Feb 2020, 10:13 PM
Gabriel Ilie
Gabriel Ilie - avatar
+ 1
Example: Select * from clients where name like ‘%arra%’. This will return all the clients for witch the name contains arra no metter the positon
17th Feb 2020, 10:16 PM
Gabriel Ilie
Gabriel Ilie - avatar
+ 1
thanks for the name! ive been able to google search and find information on it now :)
17th Feb 2020, 10:17 PM
liarra
liarra - avatar