MYSQL insert problems
| From: | Frank Stanovcak | Date: | Fri, 17 Oct 2008 16:22:09 +0000 |
| Subject: | MYSQL insert problems | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-282046@lists.php.net to get a copy of this message | ||
I'm using the following code to try and do a simple insert query. However
it won't insert the data into the table, and I get no error messages. What
have I done wrong this time?
<?php
session_start();
$connection = mysql_connect('localhost','yeah','right');
mysql_select_db('envelope1',$connection);
$filtered = $_SESSION['filtered'];
mysql_query('INSERT INTO shipped (FKOESalesOrder,FKUSUsers, DateEntered,
DateShipped,Quantity, Cases, Pallets, Weight, FKUSShippedBy, BillofLading,)
VALUES (' . $filtered['SalesOrder'] . ', 1, ' .
date('MM/DD/YYYY', time()) .
', ' . $filtered['ShipDate'] . ', ' . $_SESSION['quantity']
. ', ' .
$_SESSION['cases'] . ', ' . $filtered['FullPallets'] . ', '
.
$filtered['Weight'] . ', ' . $filtered['ShippedBy'] . ', ' .
$filtered['BillofLading'] . ')', $connection);
$that = mysql_query('SELECT * FROM shipped',$connection);
$i = 0;
while($result_row = mysql_fetch_array($that,MYSQL_ASSOC)) {
echo ++$i;
foreach($result_row as $key => $value) {
echo $key . ' : ' . $value . '<br>';
};
echo '<br>';
};
mysql_close($connection);
include('..\VariableReveal.php');
?>