craigglenn
Technical User
Hi all,
I think this is pretty simple but I am new to PHP.
How do I alter this line to make my search with the wildcard % at the beginning and end of my variable. I am altering some existing code.
if(!empty($searchTerms))
{
$query .= $wpdb->prepare("AND company_name LIKE %s",$searchTerms);
}
Thanks in advance for the help.
Also as a bonus question can anyone tell me what the 's' is for in the %s?
Craig
"You can have anything in life you want if you help enough people get what they want"
Zig Ziggler
I think this is pretty simple but I am new to PHP.
How do I alter this line to make my search with the wildcard % at the beginning and end of my variable. I am altering some existing code.
if(!empty($searchTerms))
{
$query .= $wpdb->prepare("AND company_name LIKE %s",$searchTerms);
}
Thanks in advance for the help.
Also as a bonus question can anyone tell me what the 's' is for in the %s?
Craig
"You can have anything in life you want if you help enough people get what they want"
Zig Ziggler