Jump to content

Complex MySQL Query


FishSword

Recommended Posts

Hiya,

 

I have a table that contains book purchase information for an online book shop.

The database structure can be found below:

  • Purchase_ID:
    Used as a unique identifier for the purchase

  • Book_ID:
    Used to store the book that was purchased

  • Customer_ID:
    Used to store the book purchaser

  • Purchase_Date:
    Used to store the purchase date.

  • Book_Selected:
    Define whether or not book is entered into competition.

 

Upon clicking a link containing a particular "Purchase ID", how do I change the value of the "Book_Selected" field to "1", whilst changing the "Book_Selected" field values to "2" for any other Purchase ID's that have the same "Book ID".

 

Cheers ;)

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.