Code: Select all
$name=$_POST['affiliate_search_for_users'];
$query = "SELECT b_firstname, b_lastname, b_state, username, b_phone_m FROM contact_info WHERE affiliate = ' ".$affiliate." ' &&
b_firstname LIKE '%" . $name ."%' OR
b_lastname LIKE '%" . $name ."%' OR
b_phone_h LIKE '%" . $name ."%' OR
b_phone_m LIKE '%" . $name ."%' OR
b_phone_w LIKE '%" . $name ."%' ";
$result = mysql_query($query) or die(mysql_error());I've even test " print $affiliate ; " and it shows me the proper result, so the correct variable is being used.
This thing has been handing me my ass for hours. Can anyone out there help a beginner?
Thanks...
Basically, I want to search an affiliate's records based on firstname, lastname, etc..., but the record MUST belong to that affiliate.