RE: [PHP] PHP MySQL Insert Syntax
| From: | admin at buskirkgraphics dot com | Date: | Tue, 01 Apr 2008 17:54:36 +0000 |
| Subject: | RE: [PHP] PHP MySQL Insert Syntax | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-272422@lists.php.net to get a copy of this message | ||
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