Hi! Could we please enable some services and cookies to improve your experience and our website?

PHPize Online / SQLize Online  /  SQLtest Online

A A A
Login    Share code      Blog   FAQ

Online Sandbox for SQL and PHP: Write, Run, Test, and Share SQL Queries and PHP Code

Copy Format Clear
create table reg ( balance int, card varchar(16), code varchar(16) );

Stuck with a problem? Got Error? Ask AI support!

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();
Copy Clear