Re: [PHP-DB] Multiple inserts into a database

2006-12-03 Thread Chris
Daniel Smith wrote: select itemname from deals d, items i, deal_items di where d.dealid=di.dealid and i.itemid = di.itemid and dealname="meal 1"; Would I be correct in thinking that the above is in effect the same as: select itemname from deals, items, deal_items where deals.dealid=deal_items

Re: [PHP-DB] Multiple inserts into a database

2006-12-01 Thread Daniel Smith
> select itemname from deals d, items i, deal_items di where > d.dealid=di.dealid and i.itemid = di.itemid and dealname="meal 1"; Would I be correct in thinking that the above is in effect the same as: select itemname from deals, items, deal_items where deals.dealid=deal_items.dealid and item

Re: [PHP-DB] Multiple inserts into a database

2006-11-30 Thread Chris
Daniel Smith wrote: The kind of thing I'm looking to do is to insert a variable number of records into a database as a consequence of a form entry. I am using PHP with a MySQL database to store information that is vaguely analogous to a fast food online ordering system. I have a table containing

[PHP-DB] Multiple inserts into a database

2006-11-30 Thread Daniel Smith
The kind of thing I'm looking to do is to insert a variable number of records into a database as a consequence of a form entry. I am using PHP with a MySQL database to store information that is vaguely analogous to a fast food online ordering system. I have a table containing individual items with

Re: [PHP-DB] Multiple Inserts

2004-06-23 Thread Achieve IT
Thanks for the suggestions. I have $TimeSheetID=$_POST['TimeSheetID']; at the start of the script. However, what I neglected to mention is that TimeSheetID is auto_increment, in first table, tblTimesheet. I will try the other suggestions, and respond with my results. Thanks, Declan. -

Re: [PHP-DB] Multiple Inserts

2004-06-22 Thread Daniel Clark
Good point. Since it's form data, what about $_POST['TimesheetID'] ? > Don't see anything obviously wrong with your query string. Are the inserts > happening in the same block of code, i.e., are you sure that > _$TimesheetID_ has a value in it when you're performing the second insert? > > > -dave

Re: [PHP-DB] Multiple Inserts

2004-06-22 Thread Daniel Clark
Any errors? Is the all the other data inserting into the second table? > Hello, > I am using a form to Insert data into 2 tables in the same database. > > $TimesheetID needs to be in each table. However, it is not being inserted > into the second table, "tblTimesheetDetails" . Any advise? > > $r

Re: [PHP-DB] Multiple Inserts

2004-06-22 Thread dpgirago
Don't see anything obviously wrong with your query string. Are the inserts happening in the same block of code, i.e., are you sure that _$TimesheetID_ has a value in it when you're performing the second insert? -dave > I am using a form to Insert data into 2 tables in the same database. > $

[PHP-DB] Multiple Inserts

2004-06-22 Thread Achieve IT
Hello, I am using a form to Insert data into 2 tables in the same database. $TimesheetID needs to be in each table. However, it is not being inserted into the second table, "tblTimesheetDetails" . Any advise? $result_timesheet=mysql_query("INSERT INTO tblTimesheet (TimesheetID, WorkerID, ClientID

Re: [PHP-DB] Multiple inserts revisited

2003-05-30 Thread Becoming Digital
Mike [LSS]" <[EMAIL PROTECTED]> To: "'Becoming Digital'" <[EMAIL PROTECTED]>; "PHP-DB" <[EMAIL PROTECTED]> Sent: Thursday, 29 May, 2003 08:00 Subject: RE: [PHP-DB] Multiple inserts revisited > -Original Message- > From: Becoming Di

RE: [PHP-DB] Multiple inserts revisited

2003-05-29 Thread Ford, Mike [LSS]
> -Original Message- > From: Becoming Digital [mailto:[EMAIL PROTECTED] > Sent: 28 May 2003 23:38 > > My other option, as I saw it, was to loop through the items, > appending value > data to the query text with each iteration. If that seems > cryptic, here's a > basic idea of what I mea

[PHP-DB] Multiple inserts revisited

2003-05-29 Thread Becoming Digital
The subject would lead you to believe that this is a "check the archives" post. Worry not, I already did. Besides, this is more informative than anything. I'm working on a catalogue (menu, really) admin page from which a client will set their daily specials. My design calls for the user to selec

Re: [PHP-DB] Multiple Inserts with mySQL

2002-11-14 Thread Adam Voigt
10 Seconds searching in the MySQL Manual: http://www.mysql.com/doc/en/ANSI_diff_Transactions.html You have to use InnoDB tables, but this will work. On Thu, 2002-11-14 at 11:26, Anthony wrote: > hmm, I guess that would work. There is no way to have mySQL check for > integrity for me is there?

Re: [PHP-DB] Multiple Inserts with mySQL

2002-11-14 Thread Anthony
hmm, I guess that would work. There is no way to have mySQL check for integrity for me is there? I read in a SQL book a while ago about wrapping multiple inserts in a select statement, that way if any part of the statement failed the whole thing would be rolled back. From my research though,

Re: [PHP-DB] Multiple Inserts with mySQL

2002-11-14 Thread Anthony
hmm, I guess that would work. There is no way to have mySQL check for integrity for me is there? I read in a SQL book a while ago about wrapping multiple inserts in a select statement, that way if any part of the statement failed the whole thing would be rolled back. From my research though,

Re: [PHP-DB] Multiple Inserts with mySQL

2002-11-13 Thread Peter Beckman
Try this: $stack is an array of hashes: $stack[0] = array(0=>tablename, 1=>insertid()); For each insert you do, push an anonymous array on $stack which includes the tablename and insertid of the insert. Then as you continue your inserts, if any of them fail, call a function which takes that arr

[PHP-DB] Re:[PHP-DB] multiple inserts

2002-04-20 Thread adi
"Barry Rumsey" <[EMAIL PROTECTED]> wrote on 4/21/2002 4:58:21 AM: > >I have the following insert : >mysql_connect( "localhost", "", "" ); > mysql_select_db( "" ); > > mysql_query("INSERT INTO music_album VALUES >(NULL, '$artist_id' ,'$album' ,NULL ,NULL)"); > > my

AW: [PHP-DB] multiple inserts

2002-04-20 Thread Thomas Schön
i think, your sql-statement isn´t correct. Maybe you don´t insert the right count of values, or you try to insert NULL in a "NOT NULL"-defined column. Try to "echo" the statement and run it with phpMyAdmin, wich will show you the position of your error in your statement. mysql_insert_id() gives y

[PHP-DB] multiple inserts

2002-04-20 Thread Barry Rumsey
I have the following insert : mysql_connect( "localhost", "", "" ); mysql_select_db( "" ); mysql_query("INSERT INTO music_album VALUES (NULL, '$artist_id' ,'$album' ,NULL ,NULL)"); mysql_query("INSERT INTO music_songs VALUES (NULL ,NULL ,NULL ,NULL ,'$songn