Jump to content

Recommended Posts

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!

Link to comment
https://forums.phpfreaks.com/topic/132219-mysql-select-double-condition/
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.