hello Dear friend
i can't explain cause i dont' know why, i'm using the code below to insert data into a myql table but i work fine ust today i get a error colum subtotal can't be null... i' have try too much thing but still same i delete the colum subtotal in database and in php (insert into table...)
and same errot for next colum can somebody explaain why i get 'Column 'total' cannot be null' in my page when i submit to insert the data??? below is the code:
if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "valide")) {
$insertSQL = sprintf("INSERT INTO commande (sku, client, `date`, subtotal, total) VALUES (%s, %s, %s, %s, %s)",
GetSQLValueString($_POST['sku'], "text"),
GetSQLValueString($_POST['client'], "text"),
GetSQLValueString($_POST['date'], "date"),
GetSQLValueString($_POST['subtotal2'], "double"),
GetSQLValueString($_POST['total'], "int"));
mysql_select_db($database_marketbase, $marketbase);
$Result1 = mysql_query($insertSQL, $marketbase) or die(mysql_error());
$insertGoTo = "../myspace/order-line.php";
if (isset($_SERVER['QUERY_STRING'])) {
$insertGoTo .= (strpos($insertGoTo, '?')) ? "&" : "?";
$insertGoTo .= $_SERVER['QUERY_STRING'];
echo $insertGoTo;
}
header(sprintf("Location: %".$insertGoTo));
}
<form name="valide" method="POST" action="<?php echo $editFormAction; ?>">
<label for="Sub total"></label>
<label for="shipping">Sub total</label><input name="subtotal2" type="text" disabled value="<?php echo number_format($row_total['sub_total'], 2, '.', ''); ?>" readonly disabledid="subtotal2">
<label for="shipping">Shipping</label>
<input name="shipping" type="text" id="shipping" value="<?php echo number_format($row_total['shipping'], 2, '.', ''); ?>" readonly>
<label for="total"></label>
<label for="shipping">Total</label><input name="total" type="text" disabled id="total" value="<?php echo number_format ($row_total['total'], 2, '.', ''); ?>" readonly>
<input name="date" type="hidden" id="date" value="<?php echo $row_total['date']; ?>">
<input name="sku" type="hidden" id="sku" value="<?php echo $row_total['sku']; ?>">
<input type="hidden" name="client" id="client" value="<?php echo $_SESSION['MM_Username'] ?>">
<input type="submit" name="button" id="button" value="Place an order">
<input type="hidden" name="MM_insert" value="valide">
</form>