Jump to content

where clause problem!


DjNaF

Recommended Posts

hello;

i have this table (restcards_tbl) ,
[b]both are primary keys[/b]
+--------+--------+
| restid | cardid |
+--------+--------+
| 1 | 1 |
| 1 | 2 |
| 1 | 4 |
| 1 | 6 |
| 15 | 1 |
| 15 | 2 |
| 15 | 3 |
| 15 | 4 |
| 15 | 12 |
+--------+--------+

and this table (cards_tbl)

+--------+------------------+
| CardID | CardName |
+--------+------------------+
| 1 | Visa |
| 2 | Master Card |
| 3 | American Express |
| 4 | GO Card |
| 5 | Golden Card |
| 6 | Green Card |
| 7 | Silver Card |
| 12 | Bronze Card |
+--------+------------------+

every restaurant have an id RESTID.
and CARDID means , the id of the cards accepted in the restaurants.

i want a coide that the user can search for the restaurants that accepts for example
Visa AND MasterCard AND American Express

and it displayes the id for those restaurants!

i tried
[code]select restid from restcards_tbl where cardid=1 and cardid=2 and cardid=3[/code]

but no results :(
if any1 has a php code to help me display results i'd be grateful

Thank you
Link to comment
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.