This is a discussion on Insert Statement within the MySQL Database forums, part of the Database Forums category; Hi I'm currently trying to write a semi complex insert statement. I have been able to use insert and ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
Hi I'm currently trying to write a semi complex insert statement.
I have been able to use insert and select together, however am having to luck in adding addition fields to the update. This works OK INSERT INTO picture (`GalleryID`, `Team` ) SELECT galleries.GalleryID, categories.Team FROM galleries CROSS JOIN categories WHERE galleries.GalleryName = 'Holiday Pictures' AND categories.Team = '2' However want to update more rows with data Need to insert values to fields like FileName, Date, Caption etc.... This information is coming directly from the page, generated from iptc information etc. How do I go about this... Its not the standard INSERT INTO () VALUE () statement I'm using mySQL.. Any ideas. Thank you |
|
|||
|
== Quote from davidjohnlong@googlemail.com (davidjohnlong@googlemail.com)'s article
> Hi I'm currently trying to write a semi complex insert statement. > I have been able to use insert and select together, however am having > to luck in adding addition fields to the update. > This works OK > INSERT INTO picture (`GalleryID`, `Team` ) > SELECT galleries.GalleryID, categories.Team > FROM galleries > CROSS JOIN categories > WHERE galleries.GalleryName = 'Holiday Pictures' AND categories.Team = > '2' > However want to update more rows with data > Need to insert values to fields like FileName, Date, Caption etc.... > This information is coming directly from the page, generated from iptc > information etc. How do I go about this... Its not the standard INSERT > INTO () VALUE () statement > I'm using mySQL.. > Any ideas. > Thank you select and insert can work together as you've shown above; however, i don't believe you can do the same with update. if that's what you're asking. -- POST BY: lark with PHP News Reader |