Hi, I am having some problems with my mySQL query when referencing from PHP. When the user first signs up they select from a list of interests 7 times. So when the search is done it could be in any 7 of the positions. Here is the error that I am getting.
SELECT clients.CUserName,clients.CFirstName,clients.CLastName,clients.CCity,clients.CGender,clients.CMarital,clients.CCommunity,clients.CHeight,clients.CKids,clients.CBody,clients.CEducation,clients.CChurch,clients.CEmail,i1,i2,i3,i4,i5,i6,i7 FROM clients,interests WHERE (CCity LIKE '%' AND CHeight LIKE '%' AND CKids LIKE '%' AND CAge LIKE '%' AND CMarital LIKE '%' AND Interests LIKE '' OR '' OR '' OR '' OR '' OR '' OR '' AND clients.CUserName = interests.CUserName) ORDER BY CCity, CLastName
Warning: Supplied argument is not a valid MySQL result resource in c:\phpweb/searchresults1.php on line 462
Found profiles that matched your search criteria.
Here is the original code for the query:
$query = "SELECT clients.CUserName,clients.CFirstName,clients.CLastName,clients.CCity,clients.CGender,clients.CMarital,clients.CCommunity,clients.CHeight,clients.CKids,clients.CBody,clients.CEducation,clients.CChurch,clients.CEmail,i1,i2,i3,i4,i5,i6,i7
FROM clients,interests
WHERE
(CCity LIKE '$Qcity'
AND CHeight LIKE '$Qheight'
AND CKids LIKE '$Qkids'
AND CAge LIKE '$Qage'
AND CMarital LIKE '$Qmarital'
AND Interests LIKE '$Interests1' OR '$Interest2' OR '$Interest3' OR '$Interest4' OR '$Interest5' OR '$Interest6' OR '$Interest7'
AND clients.CUserName = interests.CUserName)
ORDER BY CCity, CLastName
any suggestions would be greatly appreciated!Thanks in Advance!