RE: [PHP-WIN] Access sql question

From: Date: Tue, 10 Oct 2000 13:35:36 +0000
Subject: RE: [PHP-WIN] Access sql question
Groups: php.windows 
Request: Send a blank email to php-windows+get-3093@lists.php.net to get a copy of this message
For the record, the following works (only once because it won't let me duplicate the primary key...) $sql = "INSERT INTO hello SELECT * FROM hello2"; --------------------- John Asendorf - jasendorf@lcounty.com Web Applications Developer http://www.lcounty.com - NEW FEATURES ADDED DAILY! Licking County, Ohio, USA 740-349-3631 > -----Original Message----- > From: Asendorf, John [mailto:JAsendorf@lcounty.com] > Sent: Tuesday, October 10, 2000 9:32 AM > To: Andrian Pervazov; alain@samoun.com > Cc: Php-Windows@Lists. Php. Net (E-mail) > Subject: RE: [PHP-WIN] Access sql question > > > OK, that seemed much closer.... > > Warning: SQL error: [Microsoft][ODBC Microsoft Access Driver] > Number of > query values and destination fields are not the same., SQL > state 21S01 in > SQLPrepare in > D:\InetPub\wwwroot\is\website\test_center\access\dbinsert.php > on line 53 > > $sql = "INSERT INTO hello > (department,telephone,address1,address2,city,state,zip,floor) > SELECT (department,telephone,address1,address2,city,state,zip,floor) > FROM hello2"; > > > > --------------------- > John Asendorf - jasendorf@lcounty.com > Web Applications Developer > http://www.lcounty.com - NEW FEATURES ADDED DAILY! > Licking County, Ohio, USA > 740-349-3631 > > > > -----Original Message----- > > From: Andrian Pervazov [mailto:apervazov@aspen-marketing.com] > > Sent: Tuesday, October 10, 2000 8:56 AM > > To: alain@samoun.com > > Cc: Php-Windows@Lists. Php. Net (E-mail) > > Subject: Re: [PHP-WIN] Access sql question > > > > > > It should be "insert into table2 (field1,field2) select > > (field1n,field2n) from table1 > > > > At least that's how it is on SQL Server > > > > Andrian > > > > alain samoun wrote: > > > > > > Slightly OT: > > > I'm not too familiar with Access db, can I do something like: > > > $sql = "insert into table2 (field1,field2) values( select > > (field1n,field2n) > > > from table1)"; > > > where the corresponding fields have the same type. > > > Message from Alain Samoun > > > alain@samoun.com > > > > > > -- > > > PHP Windows Mailing List (http://www.php.net/) > > > To unsubscribe, e-mail: php-windows-unsubscribe@lists.php.net > > > For additional commands, e-mail: php-windows-help@lists.php.net > > > To contact the list administrators, e-mail: > > php-list-admin@lists.php.net > > > > -- > > PHP Windows Mailing List (http://www.php.net/) > > To unsubscribe, e-mail: php-windows-unsubscribe@lists.php.net > > For additional commands, e-mail: php-windows-help@lists.php.net > > To contact the list administrators, e-mail: > > php-list-admin@lists.php.net > > > > -- > PHP Windows Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-windows-unsubscribe@lists.php.net > For additional commands, e-mail: php-windows-help@lists.php.net > To contact the list administrators, e-mail: > php-list-admin@lists.php.net >

« previous php.windows (#3093) next »