Bluehost.com Web Hosting $6.95

Insert Statement

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 ...


Go Back   Usenet Forums > Database Forums > MySQL Database

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 05-28-2007
davidjohnlong@googlemail.com
 
Posts: n/a
Default Insert Statement

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

Reply With Quote
  #2 (permalink)  
Old 05-29-2007
lark
 
Posts: n/a
Default Re: Insert Statement

== 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
Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT +1. The time now is 10:18 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0