如何保证小数?在Mysql中,我有type = Decimal value = 6,2。预先感谢您的帮助
<li>
<label for="price" class="text">Price:</label>
<input name="price" type="text" id="price" tabindex="210"/>
</li>
$price = $_POST["price"];
要么
$price = mysqli_real_escape_string($connection, $price);
最佳答案
采用:
$price = filter_input(INPUT_POST, 'price', FILTER_VALIDATE_FLOAT);
关于php - 小数保护php mysql,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20002848/