简体   繁体   中英

Decimal protect php mysql

How to secure decimal? In Mysql I have type=Decimal value=6,2. Thank you in advance for your help

   <li> 
            <label for="price" class="text">Price:</label>
            <input name="price" type="text" id="price" tabindex="210"/>
   </li>

$price = $_POST["price"];

or

$price = mysqli_real_escape_string($connection, $price);

采用:

$price = filter_input(INPUT_POST, 'price', FILTER_VALIDATE_FLOAT);

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM