I'm working on a Wordpress plugin to search through all the users by first name, last name, email etc. It is working as long as I only use 1 of the values like first name. I need to add all the values to the select!
I already tried adding more by using ',' and OR statements but it isn't working.
$results = $wpdb->prepare("SELECT * FROM users WHERE first_name LIKE %s", "%".$_POST['search']."%");
EDIT: found it
Found it!
$results = $wpdb->prepare("SELECT * FROM users WHERE lower(first_name) LIKE lower (%s) OR lower(last_name) LIKE lower(%s) LIKE lower(%s)OR lower(postcode) LIKE lower(%s)", "%".$_POST['search']."%", "%".$_POST['search']."%");