Re: INSERT INTO multiple tables

2010-04-13 Thread Chris W
I have no idea how you got here but there is no reason to do it that way. This will work just fine and I do it every day in php. However I don't use mysqli I still use ... mysql_connect mysql_select_db mysql_real_escape_string mysql_query Don't forget to use the mysql_real_escape_string

Re: INSERT INTO multiple tables

2010-04-13 Thread Gary
Colin Thank you for your reply. I had previously found the page you linked in your original post, however at this stage of my development, my imagination creates error messages and not inovative solutions. I have found some other issues that are presenting road blocks, once I solve them, I

Re: INSERT INTO multiple tables

2010-04-13 Thread Gary
Chris. Thanks for your response. I read somewhere that the mysqli was better, so I have been using it. This exercise is an experiment, on my local machine only, so I ommitted any escape functions. I am trying to create DB's with multiple tables, so it is totally a learning exercise. So

Re: INSERT INTO multiple tables

2010-04-12 Thread Gary
Seriously You should read your answers before you post, the SA link did not provide the answer. Had you read the page you sent, you would notice it does not apply to mulitple tables... Gary Colin Streicher co...@obviouslymalicious.com wrote in message

Re: INSERT INTO multiple tables

2010-04-12 Thread Michael Dykman
It is not a question of multiple tables, it is a question of multiple statements. Most PHP configurations prohibit the application of more than one statement per call to execute. This is generally thought to be a security issue as the vast majority of simple PHP-based SQL injection attacks only

Re: INSERT INTO multiple tables

2010-04-12 Thread Gary
Michael Thank you for your response. It gave me the idea how to solve this, and it seemed to have worked! For those following hoping to see a solution, what I did was open the connection, insert into one table, closed the connection, closed the php script, and the data was inserted into 2 of

Re: INSERT INTO multiple tables

2010-04-12 Thread Colin Streicher
Normally I would avoid getting into this sort of argument ( The 'OMG someone on teh internets are wrong!!' argument) But in this case, the solution ( still the first result in a google search) is far more efficient than closing a connection so you can insert into another table. You are

INSERT INTO multiple tables

2010-04-11 Thread Gary
I am experimenting with multiple tables, it is only a test that is my local machine only. This is the current code, which does not work , I have tried to concatonate the insert statements. I have tried multiple $query variables, but it is just overwriting itself (only the last one gets inserted).

Re: INSERT INTO multiple tables

2010-04-11 Thread viraj
is it mysqli query or 'multi_query'? http://php.net/manual/en/mysqli.multi-query.php ~viraj On Sun, Apr 11, 2010 at 10:27 PM, Gary gwp...@ptd.net wrote: I am experimenting with multiple tables, it is only a test that is my local machine only. This is the current code, which does not work , I

Re: INSERT INTO multiple tables

2010-04-11 Thread Colin Streicher
Seriously... I found the answer in the first result. http://lmgtfy.com/?q=mysqli+multiple+insert+statements Assuming mysqli, if you are using a different driver, then google that Colin On April 11, 2010 10:36:41 pm viraj wrote: is it mysqli query or 'multi_query'?

Insert into multiple tables using auto_increment reference

2007-06-11 Thread Hamish Allan
Hi, Is it possible to insert values into two tables simultaneously and have the value of one of the columns in the second table be the auto_increment value from inserting into the first? E.g. if table1 has an auto_increment column c1, the logic I'm looking for would be something like: INSERT

Re: Insert into multiple tables using auto_increment reference

2007-06-11 Thread Baron Schwartz
Hi, Hamish Allan wrote: Hi, Is it possible to insert values into two tables simultaneously and have the value of one of the columns in the second table be the auto_increment value from inserting into the first? No, because you can only insert into one table at a time. But you can write a

Re: Insert into multiple tables using auto_increment reference

2007-06-11 Thread Hamish Allan
On 6/11/07, Baron Schwartz [EMAIL PROTECTED] wrote: Hi, Hamish Allan wrote: Hi, Is it possible to insert values into two tables simultaneously and have the value of one of the columns in the second table be the auto_increment value from inserting into the first? No, because you can only

insert into multiple tables??

2002-05-15 Thread Defryn, Guy
Is it possible to insert data into different tables with one insert statement. For example , I have one form on my web page and the data needs to go into different tables( first 5 entries to table A and the rest to table B)? Mysql

RE: insert into multiple tables??

2002-05-15 Thread Lopez David E-r9374c
Guy No. Requires multiple inserts. David -Original Message- From: Defryn, Guy [mailto:[EMAIL PROTECTED]] Sent: Wednesday, May 15, 2002 4:55 PM To: [EMAIL PROTECTED] Subject: insert into multiple tables?? Is it possible to insert data into different tables with one insert