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 hopef

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 wi

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 funct

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 correc

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

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" wrote in message news:201004112310.16594.co...@obviouslymalicious.com... > Serious

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'? > > http://php.net/manual/e

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 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 have tried >

Re: Insert into...on duplicate key problem

2008-07-12 Thread Rob Wultsch
On Wed, Jul 9, 2008 at 9:37 AM, Phil <[EMAIL PROTECTED]> wrote: > Is it possible to do an insert into with subselect and group by with an > additional on duplicate insert ? > > CREATE TABLE NEW_TABLE ( > `a` varchar(10), > `b` double > ) engine=MyISAM; > > > INSERT INTO NEW_TABLE (select old.x,su

Re: Insert into...on duplicate key problem

2008-07-09 Thread Phil
Sorry, that was just a typo, should have been INSERT INTO NEW_TABLE (select old.x,sum(old.y) from OLD_TABLE old group by old.x) on duplicate key update b=sum(old.y); but this gives ERROR (HY000): Invalid use of group function INSERT INTO NEW_TABLE (select old.x,sum(old.y) from OLD_TAB

Re: Insert into...on duplicate key problem

2008-07-09 Thread Ananda Kumar
you should say "group by old.x" and not "old.a" On 7/9/08, Arthur Fuller <[EMAIL PROTECTED]> wrote: > > I think that you need to select old.a otherwise you cannot group by it. > > Arthur > > On 7/9/08, Phil <[EMAIL PROTECTED]> wrote: > > > > Is it possible to do an insert into with subselect and g

Re: Insert into...on duplicate key problem

2008-07-09 Thread Arthur Fuller
I think that you need to select old.a otherwise you cannot group by it. Arthur On 7/9/08, Phil <[EMAIL PROTECTED]> wrote: > > Is it possible to do an insert into with subselect and group by with an > additional on duplicate insert ? > > CREATE TABLE NEW_TABLE ( > `a` varchar(10), > `b` double

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

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 sto

Re: insert into some table show status like 'foo'

2006-12-15 Thread Chris Comparini
On Friday 15 December 2006 11:53, Steve Edberg wrote: > At 11:12 AM -0800 12/15/06, Chris Comparini wrote: > >Hello, > > > >Say I wanted to log some various server status variables to > >a table. What I'd like to do, ideally, is something like > >this: > > > >insert into SomeLogTable (Threads) sho

Re: insert into some table show status like 'foo'

2006-12-15 Thread Steve Edberg
At 11:12 AM -0800 12/15/06, Chris Comparini wrote: Hello, Say I wanted to log some various server status variables to a table. What I'd like to do, ideally, is something like this: insert into SomeLogTable (Threads) show status like 'Threads_running'; MySQL does not allow this, of course. Bu

Re: insert into some table show status like 'foo'

2006-12-15 Thread Chris Comparini
On Friday 15 December 2006 11:23, Mikhail Berman wrote: > Hi Chris, > > If you are running on *Nix you could write a script generally structured > like: > > do > - show status | grep 'what_ever_string_you_want_to_see' > - insert into table > - sleep [seconds] > done > Yes, we are

RE: insert into some table show status like 'foo'

2006-12-15 Thread Mikhail Berman
Hi Chris, If you are running on *Nix you could write a script generally structured like: do - show status | grep 'what_ever_string_you_want_to_see' - insert into table - sleep [seconds] done I am not sure how to do the same in Windows Regards Mikhail Berman -Or

RE: insert into... select... duplicate key

2005-09-25 Thread Schimmel LCpl Robert B \(GCE 2nd Intel Bn Web Master\)
Subject: Re: insert into... select... duplicate key Relevant bits of the conversation so far, with my thoughts at the end: Schimmel LCpl Robert B (GCE 2nd Intel Bn Web Master) wrote: > Here is the problem that I am having. I am trying to make a copy of a > full record in a table that has a p

Re: insert into... select... duplicate key

2005-09-25 Thread Michael Stassen
Relevant bits of the conversation so far, with my thoughts at the end: Schimmel LCpl Robert B (GCE 2nd Intel Bn Web Master) wrote: Here is the problem that I am having. I am trying to make a copy of a full record in a table that has a primary key with auto-increment. The real problem is that I

Re: insert into... select... duplicate key

2005-09-25 Thread Danny Stolle
I am not familiour with Cold Fusion but: cant you use 'show columns from table' ?? and use the result object? This normally works in e.g. C or PHP danny Schimmel LCpl Robert B (GCE 2nd Intel Bn Web Master) wrote: I am using Cold Fusion and as I stated in my original message, if I were using

RE: insert into... select... duplicate key

2005-09-25 Thread Schimmel LCpl Robert B \(GCE 2nd Intel Bn Web Master\)
I am using Cold Fusion and as I stated in my original message, if I were using MySQL 5, then I could use information_schema to retrieve the column names in the table and do it with variables in Cold Fusion. I do that on all my pages on the MySQL 5 servers with which I work. However, the server I am

Re: insert into... select... duplicate key

2005-09-25 Thread Danny Stolle
Well I haven't realy found a select method in which you can isolate a field. Like a complementary method, in which you select like one field, but shows the fields except the field which you have used in your select-statement. So you excually want to dynamically insert the records, not knowing

RE: insert into... select... duplicate key

2005-09-25 Thread Schimmel LCpl Robert B \(GCE 2nd Intel Bn Web Master\)
That is the effect that I am looking for, but exactly the method that I am trying to avoid. If I type the column names into my INSERT... SELECT and someone later adds a column to the table, I would have to go back into my program and update the statement. I am looking for a way to do it dynamically

Re: insert into... select... duplicate key

2005-09-25 Thread Danny Stolle
Hi, I am hoping you meen this: You have to use the fields in your into -statement and select statement, not including the field having the auto-numbering so if e.g. field1 has autonumbering -> insert into table1 (field2, field3) select (field2, field3) from table1; autonumbering will automat

Re: Insert Into problem

2005-08-30 Thread Ed Reed
Thanks guys! >>> [EMAIL PROTECTED]> 8/30/05 1:22 PM >> The correct syntax for the second method doesn't use "VALUES()". I would always use this form if I were going to exclude any columns from receiving data. It's just safer and relies less on the SQL engine to correctly divine what it is y

Re: Insert Into problem

2005-08-30 Thread SGreen
"Ed Reed" <[EMAIL PROTECTED]> wrote on 08/30/2005 04:08:57 PM: > Can anyone please tell me why this fails, I've done this type of > thing before without a problem > > Insert Into tbl1 Select 10306, fld2, fld3, fld4 From tbl1 Where fld1=8114 > > > tbl1 has five fields all ints with fld5 being

Re: Insert Into problem

2005-08-30 Thread Eamon Daly
Drop the VALUES part in your second attempt: INSERT INTO tbl1 (fld1, fld2, fld3, fld4) SELECT 10306, fld2, fld3, fld4 FROM tbl1 WHERE fld1 = 8114 Note that you'll need to be running MySQL 4.0.14 or above to insert into the same table you're selecting from. __

Re: insert into text field

2004-06-27 Thread Eric Bergen
desc is a reserved word. http://dev.mysql.com/doc/mysql/en/Reserved_words.html In most cases to use desc as a column you will have to escape it with backticks like this `desc`. -Eric On Sat, 26 Jun 2004 16:19:37 +0530, Nitin <[EMAIL PROTECTED]> wrote: > > Hi all, > > There's a problem. When

Re: insert into text field [Solved]

2004-06-26 Thread Michael Stassen
t;Nitin" <[EMAIL PROTECTED]> Sent: Saturday, June 26, 2004 4:33 PM Subject: Re: insert into text field look *carefully* at the insert syntax, paying attention to spaces and the like: INSERT INTO tbl_name () VALUES() the error message gives a good hint too. -- Original M

Re: insert into text field [Solved]

2004-06-26 Thread Nitin
Solved. - Original Message - From: <[EMAIL PROTECTED]> To: "Nitin" <[EMAIL PROTECTED]> Sent: Saturday, June 26, 2004 4:33 PM Subject: Re: insert into text field > look *carefully* at the insert syntax, paying attention to spaces and > the like: > >

Re: insert into table select ...

2004-05-18 Thread Egor Egorov
Gaspar Bakos <[EMAIL PROTECTED]> wrote: > > I am trying to duplicate a row of a table in the following way: > > insert into Observer select * from Observer where OBid = 4; > ERROR 1066: Not unique table/alias: 'Observer' > > It is a unique table; I mean there can't be another table named in the

Re: "INSERT INTO" dropping slashes from strings

2004-05-08 Thread Lou Olsten
The backslash (\) is an escape character (http://dev.mysql.com/doc/mysql/en/String_syntax.html). So to enter a backslash into a text field, you would have to say: txtSceneFile = "C:\\Data\\test\\foo\\bar.lws". Lou - Original Message - From: "Steve Pugh" <[EMAIL PROTECTED]> To: <[EMAIL P

Re: INSERT into HEAP table

2004-05-05 Thread Egor Egorov
"Vladimir Romanovski" <[EMAIL PROTECTED]> wrote: > Hi All! > > We use MySQL 3.23.54 on ReadHat 8.0. > What error code is returned for inserting into heat table over > memory(row) limit? > > You will get something like: ERROR 1114 : The table 'tbl_name' is full -- For technical sup

Re: "INSERT INTO" dropping slashes from strings

2004-05-04 Thread Steve Pugh
Ah!! I was tripped up by the fact that things were fine when I was doing an ADO "recordset.addnew, recordset!Fieldname = variable", recordset.Update" kind of approach. Switching to an INSERT query, and sure enough the backslashes need a little escape. Don't we all need a little escape every n

Re: "INSERT INTO" dropping slashes from strings

2004-05-04 Thread Daniel Clark
Hum. I've never tried inserting without the field names. > Serves me right to type this stuff instead of copying/pasting - my > previous post was indeed wrong but also wasn't the exact code I used > (yours was, with the single quote embedded in the doubles). > > It's been a very dyslexic week for

Re: "INSERT INTO" dropping slashes from strings

2004-05-04 Thread Dan Nelson
In the last episode (May 04), Steve Pugh said: > Hello all, once again! Can anyone tell me why the following takes > place? In my VB app I am adding records to the table "Jobs" with > this code (trimmed way down - my actual INSERT statement populates > about 20 fields): > > sqlstr = "INSERT INTO

Re: "INSERT INTO" dropping slashes from strings

2004-05-04 Thread Steve Pugh
Serves me right to type this stuff instead of copying/pasting - my previous post was indeed wrong but also wasn't the exact code I used (yours was, with the single quote embedded in the doubles). It's been a very dyslexic week for me. On your previous response regarding field names and case sen

Re: "INSERT INTO" dropping slashes from strings

2004-05-04 Thread Daniel Clark
How about: (I reversed on set of quotes) sqlstr = "INSERT INTO Jobs VALUES('" & txtSceneFile & "')" > Err...what I meant to say here was "ascii code equivalent (chr(39)" (I > tried single *and* double quotes). Sorry about that. > > Steve Pugh wrote: > >> Hi Daniel, >> >> I tried that to no avai

Re: "INSERT INTO" dropping slashes from strings

2004-05-04 Thread Daniel Clark
Check the table sturcture for required fields and EXACT field names. mysql is case sensitive. > I tried that to no avail (I had actually had the code set initially to > use single quotes thusly: > > sqlstr = "INSERT INTO Jobs VALUES("' & _ > txtSceneFile & "')" > > but it generated the

Re: "INSERT INTO" dropping slashes from strings

2004-05-04 Thread Steve Pugh
Err...what I meant to say here was "ascii code equivalent (chr(39)" (I tried single *and* double quotes). Sorry about that. Steve Pugh wrote: Hi Daniel, I tried that to no avail (I had actually had the code set initially to use single quotes thusly: sqlstr = "INSERT INTO Jobs VALUES("' & _

Re: "INSERT INTO" dropping slashes from strings

2004-05-04 Thread Steve Pugh
Hi Daniel, I tried that to no avail (I had actually had the code set initially to use single quotes thusly: sqlstr = "INSERT INTO Jobs VALUES("' & _ txtSceneFile & "')" but it generated the same erroneous string. Using the ascii-code equivalent (Chr(34) does the same. It's just so

Re: "INSERT INTO" dropping slashes from strings

2004-05-04 Thread Daniel Clark
I think you want chr(39) (single quote). > Every time I think I've got it, I am reminded thatI don't got it. > > Hello all, once again! Can anyone tell me why the following takes > place? In my VB app I am adding records to the table "Jobs" with this > code (trimmed way down - my actual INS

Re: INSERT INTO ... SELECT

2004-04-01 Thread Egor Egorov
"Ricardo Lopes" <[EMAIL PROTECTED]> wrote: > I have to copy some records from one table into the same table is it > posible? > > my sql is like this: > > INSERT INTO equipamento_componentes (cod_equipamento_componentes, cod_tipo, > numero, data_colocacao, cod_componente) > > SELECT '', 'C', 65,

Re: INSERT INTO SELECT

2004-03-04 Thread Jacque Scott
OK, I found the answer. CREATE TABLE ProductSums SELECT DISTINCTROW IndenturedList.NSIPartNumber, Sum(tblInvTransaction.Qty) AS SumOfQty FROM IndenturedList;

Re: Insert into linked tables??

2004-02-12 Thread Michael Stassen
Use LAST_INSERT_ID() to get the id. LAST_INSERT_ID() is connection-specific, so you will get the correct value regardless of other users. See for more. Michael David Johnston wrote: I have a database with two tables (well more but only

Re: INSERT INTO FROM same table failing

2003-12-10 Thread Victoria Reznichenko
Ramesh <[EMAIL PROTECTED]> wrote: > > In mysql 4.014, the below INSERT statement works fine: > INSERT INTO TEST_TABLE SELECT 20, name FROM TEST_TABLE WHERE id = 10 > > But in mysql 4.1, it fails, I get a message: > Error Code : 1066 > Not unique table/alias: 'TEST_TABLE' > (10 ms taken) > > Ques

Re: INSERT INTO tbl (SELECT) UNION (SELECT) ORDER BY field-does not work. Why?

2003-12-02 Thread Sergei Golubchik
Hi! On Dec 02, George Georgeus wrote: > Hi! > I do not know how to use INSERT and UNION together. > For example: > INSERT INTO tmp_table_name (a) > (SELECT a FROM table_name WHERE a=10 AND B=1 ORDER BY > a LIMIT 10) > UNION > (SELECT a FROM table_name WHERE a=11 AND B=2 ORDER BY > a LIMIT 10) > OR

RE: INSERT INTO tbl (SELECT) UNION (SELECT) ORDER BY field-does not work. Why?

2003-12-02 Thread Wouter van Vliet
George Georgeus wrote: > Hi! > I do not know how to use INSERT and UNION together. > For example: > INSERT INTO tmp_table_name (a) > (SELECT a FROM table_name WHERE a=10 AND B=1 ORDER BY a LIMIT > 10) UNION (SELECT a FROM table_name WHERE a=11 AND B=2 ORDER > BY a LIMIT 10) ORDER BY a; It does not

Re: insert into x select * from x doesn't work

2003-09-29 Thread Matt W
Hi, 4.1.0 was released before 4.0.14 so it wouldn't have the new functionality in it. It should be in 4.1.1 but hasn't been added to the change-log yet. Matt - Original Message - From: "Director General: NEFACOMP" Sent: Monday, September 29, 2003 4:51 AM Subjec

Re: insert into x select * from x doesn't work

2003-09-29 Thread Director General: NEFACOMP
Read the docs at: http://www.mysql.com/doc/en/INSERT_SELECT.html They said that with 4.0.14 and up, that should work!!! Thanks Emery - Original Message - From: "David Precious" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Monday, September 29, 2003 10:09 Subj

Re: insert into x select * from x doesn't work

2003-09-29 Thread Director General: NEFACOMP
I think this should be reported as a BUG for version 4.1 Below is a small text retreived from the URL http://www.mysql.com/doc/en/INSERT_SELECT.html --- Prior to MySQL 4.0.14, the target table of the INSERT statement cannot appear in the FROM clause of the SELECT part of the query. This li

Re: insert into x select * from x doesn't work

2003-09-29 Thread Egor Egorov
Tedman Leung <[EMAIL PROTECTED]> wrote: > In mysql 4.1 (and since mysql 4.0.14 or something like that) I believe > it's documented that an insert into X select * from X should work. > > It's not working for me on MySQL 4.1.0 alpha, anyone else have this > problem? is it a bug? I haven't found

Re: insert into x select * from x doesn't work

2003-09-29 Thread David Precious
Hi > In mysql 4.1 (and since mysql 4.0.14 or something like that) I > believe it's documented that an insert into X select * from X should > work. IIRC, the table you're INSERTing into cannot be the same table you SELECT from - you're trying to take records from the table 'foo' and insert the

re: INSERT INTO from a SELECT does not work?

2002-12-20 Thread Egor Egorov
On Friday 20 December 2002 10:30, Thierry Michalowski wrote: > I'm trying to run the following SQL statement on a table of my MySQL DB: > > insert into MYTABLE(ID, VALUE, SORTKEY) >select T.ID, 'to to', MAX(T.SORTKEY) + 1 from MYTABLE as T group by > T.ID > > This was suggested by a SQL ex

Re: INSERT INTO from a SELECT does not work?

2002-12-20 Thread Paul DuBois
At 9:30 +0100 12/20/02, Thierry Michalowski wrote: Hello, I'm trying to run the following SQL statement on a table of my MySQL DB: insert into MYTABLE(ID, VALUE, SORTKEY) select T.ID, 'to to', MAX(T.SORTKEY) + 1 from MYTABLE as T group by T.ID You can't insert into the same table that y

Re: INSERT INTO () SELECT...

2002-11-21 Thread Jocelyn Fournier
day, November 22, 2002 12:30 AM Subject: Re: INSERT INTO () SELECT... > Hi Eric, > >thats oracle function INSERT INTO ... SELECT. it doesn't work in >mysql. > >Mirza >[EMAIL PROTECTED] > > __ > 21.11.2002

Re: INSERT INTO () SELECT...

2002-11-21 Thread Mirza Muharemagic
Hi Eric, thats oracle function INSERT INTO ... SELECT. it doesn't work in mysql. Mirza [EMAIL PROTECTED] __ 21.11.2002 22:13 > Hi, > This should work, I think, but doesn't > INSERT INTO holds (ord_num) > SELECT orders.ord_num FROM orde

RE: INSERT INTO () SELECT...

2002-11-21 Thread Jennifer Goodie
http://www.mysql.com/doc/en/INSERT_SELECT.html You cannot select from the table you are inserting into. Insert into a temp table and then insert into holds from that table. -Original Message- From: Eric [mailto:[EMAIL PROTECTED]] Sent: Thursday, November 21, 2002 1:14 PM To: [EMAIL PROTE

Re: INSERT INTO ... SELECT question

2002-11-14 Thread Paul DuBois
At 11:15 -0600 11/14/02, Greg Macek wrote: Thanks for the tip! Looks like I can change my date_archived field to timestamp(8), since all I care about for this is the date information (actual time is useless to me). My sql query all of a sudden got a lot simpler. Thanks again for the help! TIMEST

Re: INSERT INTO ... SELECT question

2002-11-14 Thread Greg Macek
Thanks for the tip! Looks like I can change my date_archived field to timestamp(8), since all I care about for this is the date information (actual time is useless to me). My sql query all of a sudden got a lot simpler. Thanks again for the help! On Thu, 2002-11-14 at 11:07, Matthew Baranowski wr

Re: INSERT INTO ... SELECT question

2002-11-14 Thread Matthew Baranowski
Hey Greg: A slightly easier way to do this is to use a "timestamp" field. Timestamp is just a standard mysql data type. When a record is added, it records the current time. When a record is updated, the timestamp field will be set to the time of the update. http://www.mysql.com/doc/en/DATETIME.ht

Re: INSERT INTO ... SELECT question

2002-11-14 Thread Greg Macek
Well, amazingly enough, it works great! I found a test box to try it on first before implementing this on the production box. This will definitely make life easier... On Thu, 2002-11-14 at 10:14, gerald_clark wrote: > Did you try it? > Did it work? > > Greg Macek wrote: > > >Hello, > > > >I rec

re: insert into ...selct union

2002-11-05 Thread Victoria Reznichenko
John, Tuesday, November 05, 2002, 4:23:09 AM, you wrote: JC> Is it possible to do a insert into blah JC> (select...)union(select.) JC> with mysql 4.03? Yup. -- For technical support contracts, goto https://order.mysql.com/?ref=ensita This email is sponsored by Ensita.net http://www.en

re: insert into CHAR() column using KOI8-R charset

2002-10-23 Thread Victoria Reznichenko
Andrew, Tuesday, October 22, 2002, 11:27:06 PM, you wrote: AS> I setup server (my.ini/my.cnf) with AS> default-character-set = koi8_ru AS> Than do 'myisamchk -r -q' AS> It seems to use correct charset. AS> i do: AS> 1.it's ok: AS> INSERT INTO allg AS> (znum_allg,name) VALUES (20,"À") AS> 2.it

re: Insert into multi-tables

2002-09-24 Thread Victoria Reznichenko
Chuck, Tuesday, September 24, 2002, 12:44:26 AM, you wrote: CP> I have a question. I have two tables that I want to post data too. Is there CP> a way to do a sql statement that lets me post data two tables at the same CP> time? No. -- For technical support contracts, goto https://order.mysql.

Re: "INSERT INTO" vs. "REPLACE INTO"

2002-06-21 Thread olinux
You'll have much less overhead checking with a select first and then insert if not exists olinux --- Sebastian Bergmann <[EMAIL PROTECTED]> wrote: > [resent; original posting didn't make it (through > the spam protection)] > > With phpOpenTracker I have for instance the > following table >

Re: insert into from select error

2002-06-18 Thread Zak Greant
Hi David, Can you run the query in the MySQL command line client? -- __ ___ ___ __ / |/ /_ __/ __/ __ \/ /Zak Greant <[EMAIL PROTECTED]> / /|_/ / // /\ \/ /_/ / /__ MySQL AB, Advocate /_/ /_/\_, /___/\___\_\___/ Calgary, Canada <___/ www.mysql.com

Re: Insert into longblob column, it's limitation

2002-06-06 Thread Egor Egorov
¼ÛÅÂÈ£, Thursday, June 06, 2002, 1:08:07 PM, you wrote: ¼> I will attempt to give you as much information about the software as I can ¼> before I ask the question. ¼> OS : RedHat 7.1 ¼> MySQL : Version 3.23.49a for Linux -> binary distribution for pc-linux ¼> I want to insert into longblob colu

Re: INSERT INTO not working

2002-05-16 Thread Gerald Clark
Check your indexes. Daniel Lim wrote: >Hi there, >I have MySql version: 3.23.36 running on RedHat 7.1, it has been >working fine for sometimes until a day ago when the INSERT into for new >record appeared to return OK status but upon verifying the record isn't >there? > >This is an example; >

Re: INSERT INTO not working

2002-05-15 Thread Sven Bentlage
1. delete any whitespaces between the column name and the "=" and the values. 2. try using columnname="value" That works for me. On Thursday, May 16, 2002, at 09:59 AM, Daniel Lim wrote: > > Hi there, > I have MySql version: 3.23.36 running on RedHat 7.1, it has been > w

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 o

RE: insert into integer field

2002-05-06 Thread Jay Blanchard
{snip] When I try and insert a string into an integer field, instead of throwing an error MySQL accepts the insert and set that field's value to zero (I assume default value). I am using the php mysql module by the way (not PEAR). I would like to get an error when I insert the wrong data type in

Re: INSERT INTO ..... SELECT

2002-05-01 Thread Dave
This was resolved by adding an auto-increment column. MySQL does not seem capable of coping with the situation below. - Original Message - From: "Dave" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Tuesday, April 30, 2002 5:36 PM Subject: INSERT INTO . SELECT > I am having pro

Re: insert into with sub select

2002-02-27 Thread Sommai Fongnamthip
Hi rob, I have another question but still in this solution. How did you delete data which different in 2 table? Sommai At 10:28 27/2/2002 +, Rob wrote: >I've been having this problem as well, which results from mySQL not allowing >you to select and insert from the same table at th

Re: insert into with sub select

2002-02-27 Thread Sommai Fongnamthip
Hi Rob, You're right for my problem. I'll hope this solution to be fixed in MySQL someday. thanks anyway. Sommai At 10:28 27/2/2002 +, Rob wrote: >I've been having this problem as well, which results from mySQL not allowing >you to select and insert from the same table at the same

Re: insert into with sub select

2002-02-27 Thread Rob
I've been having this problem as well, which results from mySQL not allowing you to select and insert from the same table at the same time. This restriction makes some sense even in your case- mySQL wants to insert each row as it finds it in the select, but then that might change what results the

Re: insert into with sub select

2002-02-26 Thread Sommai Fongnamthip
I was successful to get result from select (this sub-select appear in MySQL manual). At 21:20 26/2/2002 -0600, Paul DuBois wrote: >At 9:18 +0700 2/27/02, Sommai Fongnamthip wrote: >>Hi, >> MySQL has insert into function and sub select (mysql style) but >> I could not conclude these func

Re: insert into with sub select

2002-02-26 Thread Paul DuBois
At 9:18 +0700 2/27/02, Sommai Fongnamthip wrote: >Hi, > MySQL has insert into function and sub select (mysql style) >but I could not conclude these function togethter. > > If I want to select not existing row in 2 table, I used: > > SELECT table1.* FROM table1 LEFT JOIN ta

Re: INSERT INTO - need some advice

2002-01-03 Thread Michael Brunson
use the LAST_INSERT_ID() sql function On Fri, 4 Jan 2002 11:32:19 +0800, Arvin Bautista used a few recycled electrons to form: | I had 2 tables, the second table had a field (a key field) that is related | to the field of the first table | | first table

Re: INSERT INTO SELECT ??

2001-10-03 Thread Paul DuBois
At 12:53 PM +0800 10/3/01, chong wee siong wrote: >Hi DBAs: > I want to copy TableA in DatabaseA to TableB in DatabaseB >with changes in the attributes of the tables, what options do I have? > >I tried these: > >a) insert into TableB (id) select (id) from DatabaseA.TableA; >this works >b) insert

Re: INSERT INTO ... SET ...

2001-07-13 Thread Rolf Hopkins
Ok, I must have been blind or something. However the question still remains. Is this an added feature of MySQL and is not part of ANSI standard? I guess it is because I've never come across it before. I have tried searching the manual again on this, especially Ch 5 but found nothing. This is w

RE: INSERT INTO ... SET ...

2001-07-13 Thread Chris Bolt
> 3. Is this a MySQL feature / bug or do other DBs support this? It doesn't work in Postgres. - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list arch

RE: INSERT INTO ... SET ...

2001-07-13 Thread Jorge del Conde
Hi, >From the manual: "The col_name=expression syntax is supported in MySQL Version 3.22.10 or later." Section 7.21 INSERT Syntax http://www.mysql.com/doc/I/N/INSERT.html Regards, Jorge For technical support contracts, visit https://order.mysql.com/ __ ___ ___ __ / |/ /_ __

Re: INSERT INTO ... SET ...

2001-07-12 Thread John Birrell
On Fri, Jul 13, 2001 at 02:56:05PM +0800, Rolf Hopkins wrote: > In all the years I have worked/studied SQL, not once have I come across the > INSERT INTO ... SET ... syntax. > My questions are: > > 1. Is this a valid statement? > 2. Is it ANSI standard? > 3. Is this a MySQL feature / bug or do ot

RE: INSERT INTO

2001-07-05 Thread Don Read
On 05-Jul-01 Ilan Fait wrote: > > > Hi, > > I am trying to insert data from one table to another with the command: > > INSERT INTO attrib_values (attrib_id,attrib_value) values (Select > attrib_id,attrib_default_value FROM attribs) > > And I get error massage: > > You have an error in yo

Re: INSERT INTO Table problems

2001-03-18 Thread Vigile
make sure the values are placed in the correct columns? Ryan Shrout Production Manager Athlonmb.com http://www.athlonmb.com [EMAIL PROTECTED] - Original Message - From: "Jason Landry" <[EMAIL PROTECTED]> To: "Ryan Shrout" <[EMAIL PROTECTED]>; <[EMAIL PRO

Re: INSERT INTO Table problems

2001-03-18 Thread Jason Landry
What's the "LIMIT 0,30" for ? Also, you should probably do this: $insert_result = mysql_query($insert_query) or die(mysql_error()); Then you wouldn't need to wait for an answer ;-) - Original Message - From: "Ryan Shrout" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Sunday, March

Re: Insert into blob

2001-02-07 Thread Teddy A Jasin
Hi okie heres a snippet of my php code: the code below takes a file uploaded from the web with $file as declared filename on the form. if ($file_size>0) { //check whether the file is not empty $data = addslashes(fread(fopen($file, "r"), filesize($file))); //read the file and add neccessary quote

Re: INSERT INTO 2 JOINED TABLES

2001-02-06 Thread Rolf Hopkins
I thought this would have been relatively easy. INSERT into T1 VALUES ... then INSERT into T2 VALUES ... and no, you can't insert into 2 tables with 1 insert statement unless the mysql team fixed that with the latest version. - Original Message - From: "Hardi Gunawan" <[EMAIL PROTECT

RE: Insert into blob

2001-02-06 Thread Roger Ramirez
Try using this function on your data before inserting into the database. http://www.php.net/manual/en/function.addslashes.php If that doesn't work show us what error you are getting. > -Original Message- > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] > Sent: Monday, February 05,

Re: Insert into blob

2001-02-05 Thread Rolf Hopkins
There's a function in php that allows you to escape strings before it is submitted to mysql. Check it out in the PHP manual. - Original Message - From: "Rus" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> Sent: Tuesday, February 06, 2

Re: Insert into blob

2001-02-05 Thread Rus
Check text for special symbols and use " in your query (f.e. ... blobfield="text") - Original Message - From: <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Tuesday, February 06, 2001 2:14 AM Subject: Insert into blob > Hi, > > I am having some problems inserting data into a blob fie

RE: INSERT INTO Statement

2001-01-21 Thread Lee Jenkins
ah, I must have to stipulate the columns I'm inserting into. I will give it a try. Thanks a bunch Lee -Original Message- From: Quentin Bennett [mailto:[EMAIL PROTECTED]] Sent: Sunday, January 21, 2001 5:11 PM To: '[EMAIL PROTECTED]'; MySQL Mail list Subject:

RE: INSERT INTO Statement

2001-01-21 Thread Quentin Bennett
Hi, You should be able to do something like INSERT INTO newtable SELECT col1, col2, col3... FROM oldtable; if the definition of col1, col2, col3... matches the structure of newtable. If it doesn't, then, you can try INSERT INTO newtable (newcol1, newcol2, newcol3...) SELECT col1, col2, col3...