我有一个简单的插入记录,用于将项添加到记录集.价格的数据字段设置为十进制,当价格字段发送时,例如9.50,它在数据库中显示为9.00.为什么?
这是php insert语句中的代码
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"));
Run Code Online (Sandbox Code Playgroud)