Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

My SQL problem.

  • 17-07-2011 8:53am
    #1
    Closed Accounts Posts: 6,281 ✭✭✭


    Hello,

    Just a quick question:

    I've got two tables, galleryInfo and gallery, Gallery info contains a column 'eventID' there are several rows in the gallery table with the column 'event' that should be deleted when I run this query

    [PHP]DELETE
    FROM gallery
    WHERE event =(SELECT eventID FROM galleryInfo WHERE ID = 20 ) [/PHP]

    I've also tried:
    [PHP]DELETE
    FROM gallery
    WHERE event IN (SELECT eventID FROM galleryInfo WHERE ID = 20 ) [/PHP]

    The subquery will only ever return one row. Can anyone help?


Comments

  • Registered Users, Registered Users 2 Posts: 49 Jethropool


    Are gallery.event and galleryinfo.eventID linked?


  • Closed Accounts Posts: 6,281 ✭✭✭Ricky91t


    Oh duh, just went to post two screen shots from PHP my admin showing how the data is linked. Turns out there were no images in the gallery for that event. *facepalm*

    Thanks Jethropool :)


Advertisement