Re: INSERT question...

From: Date: Wed, 20 Nov 2002 19:28:14 +0000
Subject: Re: INSERT question...
References: 1  Groups: php.db 
Request: Send a blank email to php-db+get-23529@lists.php.net to get a copy of this message
Quoting "NIPP, SCOTT V (SBCSI)" <sn4265@sbc.com>: > I have an INSERT statement that I cannot quiet get working. The > table that this data is being put into has 7 columns, but I only care about > putting in the data from the first two columns at this time. The first > column is an array element, and the second column needs to be a timestamp. > Here is the INSERT statement: > > $query = "INSERT INTO accounts VALUES('".$accnts[0]."', > 'TIMESTAMP(10)', , , > , ,)"; > > Here is the error being displayed on the web page: > > You have an error in your SQL syntax near ' , , ,)' at line 1 > Thanks in advance for the help. > > Scott Nipp > Phone: (214) 858-1289 > E-mail: sn4265@sbc.com > Web: http:\\ldsa.sbcld.sbc.com I believe you will need to specify the target columns, and don't attempt to use comma delimited nothings! ;-) Example: INSERT INTO accounts (col1, col2) VALUES ('val1', 'val2') -- Ryan T. Gallagher ryan@studiesabroad.com International Studies Abroad http://www.studiesabroad.com (512)480-8522

« previous php.db (#23529) next »