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
> 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
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
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
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.
-
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
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
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.
> $
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
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
> -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
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
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?
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,
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,
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
"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
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
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
19 matches
Mail list logo