Re: PHP MySQL Insert Syntax

From: Date: Tue, 01 Apr 2008 18:05:29 +0000
Subject: Re: PHP MySQL Insert Syntax
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-272423@lists.php.net to get a copy of this message
Thanks :-) <admin@buskirkgraphics.com> wrote in message news:28422285.219271207072476641.JavaMail.servlet@perfora... > Insert is for a new row > > Alter or Update is for an exsisting row > > > > > > /*I'm trying to insert values from an array into MySQL DB but the insert > begins at the last record in the table and not at first record in the > table. > I have added the cellSuffixes column after I already populated 30 records > in > other columns*/ > > Code: > > foreach($list as $key=>$value) > { > $query = "INSERT INTO carriers (cellSuffixes) VALUES('$value')"; > mysql_query($query,$connex) or die("Query failed: ". > mysql_error($connex)); > } > echo "done"; > mysql_close($connex); > > //I don't know what the sytax s/b to get the data to be inserted in the > first row of the column. > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php

« previous php.general (#272423) next »