PHPize Online / SQLize Online  /  SQLtest Online

A A A
Share      Blog   Popular
Copy Format Clear
create table reg ( balance int, card varchar(16), code varchar(16) );
Copy Clear
Copy Format Clear
<?php $stmt = $mysqli->prepare("UPDATE req SET balance = balance - ? WHERE card =? AND code = ? ;"); $stmt->bind_param("sss", $cost, $card, $code); // set parameters and execute $cost = $_GET['cost']; $card = $_POST['card']; $code = $_POST['code']; $stmt->execute();
Show:  
Copy Clear