Log in

View Full Version : Search Database Help



koustubh
02-10-2007, 09:19 AM
Hello,
I have tried following sql for searching database for multiple records in php and mysql,but the results are not showing properly. if you select only state then the search result is ok . if i selected search criteria like state,cast,Education,Monthly Income, etc then result is not showing.
Sql is As follows:
SELECT *FROM members
WHERE 'state' LIKE '%v1%' AND 'religion' LIKE '%v2%' AND 'cast' LIKE '%v3%' AND 'education' LIKE '%v4%' AND 'annual' LIKE '%v5%' AND 'marstatus' LIKE '%v6%' AND 'gender' LIKE '%v7%'

in sql v1 = $_POST['state'];
and so on..

Can anyone help me regarding this?
thanks in advanced.:)