Fsoft Posted November 11, 2008 Share Posted November 11, 2008 Hey Friends, Well I have a database and a table into it, The table have 4 fields, name, surname, country , idnumber, status! NOW ID NUM is int and auto inrement and all others are Vachars. This table have ten entries inside of it, but the problem is that there are 8 entries simliar, but in that , all the 8 names are same Ali, but in four the country is set to be India and in other it's set to be pakistan, but 6 of them have a status of V.I.P. Now the problem is , if I run a query saying "SELECT name from member where country = pakistan"; it will grab out all the names which corespond to Pakistan and they have three V.I.P and a normal person...there. But the problem is I want to run something "SELECT name from member where country = "Pakistan" & status = "V.I.P"; in this sense it will only show me up 3 Alis from paksitan who are V.I.P and fouth one will be not shown to me, But WHERE doesn't work with double condition , not for me with the code I wrote above, I might made some mistake, Please help me I want somethign to be like this "Select somthing from table where condition1 = something & condition2 = something; Hope I made it clear enough, Please help, thanks a lot, FAISAL! Quote Link to comment https://forums.phpfreaks.com/topic/132219-mysql-select-double-condition/ Share on other sites More sharing options...
luca200 Posted November 11, 2008 Share Posted November 11, 2008 SELECT name from member where country = 'Pakistan' and status = 'V.I.P' Quote Link to comment https://forums.phpfreaks.com/topic/132219-mysql-select-double-condition/#findComment-687618 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.