I have a simple insert record to add an item to a recordset. The data field for price is set to decimal and when the price field is sent e.g. 9.50 it appears in the database as 9.00. Why?
Here’s the code from the php insert statement
if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "form1")) {
$insertSQL = sprintf("INSERT INTO buying (`user`, items, price) VALUES (%s, %s, %s)",
GetSQLValueString($_POST['user'], "text"),
GetSQLValueString($_POST['items'], "int"),
GetSQLValueString($_POST['price'], "int"));
From the manual:
So, what did you specify for
D? Sounds like perhaps0.Edit
I don’t know what
GetSQLValueStringis, but you wroteGetSQLValueString($_POST['items'], "int")which seems to imply that you’re creating an integer, no?If it’s this function, I think you clearly meant
GetSQLValueString($_POST['items'], "double").