Jump to content

Comparing mutiple values in a single query


Recommended Posts

Hi,

 

I would like to ask how can I match all values I obtained from a query in a new query?

 

e.g :

Task 1

// first query I use mysql fetch array to obtain all bookID that matches my search.

e.g : SELECT * FROM `newBooks` WHERE `keyword` = 'computer' AND `new`='Y'

 

Task 2

// how can I get all the bookID fetched from a while loop above and assign it to another new query where I can obtain another value from different table ?

e.g ; SELECT * FROM `bookAuthor` WHERE `bookID` = 'All the bookID I obtained'

 

I can accomplish task 2 with a single query right? Please advise and thanks

 

 

 

 

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.