RE: PHP MySQL Insert Syntax

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux