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 `order`( id INT NOT NULL PRIMARY KEY AUTO_INCREMENT, user_id INT NOT NULL, date DATETIME NOT NULL, date_end DATETIME NOT NULL );

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

Copy Clear
Copy Format Clear
<? $pdo->prepare("INSERT INTO `order`(user_id, date, date_end) VALUES(:userId, :date, DATE_ADD(:date, INTERVAL :days DAY))") ->execute(["userId" => 100, "date" => date("Y-m-d"), "days" => 10 ]); var_dump($pdo->query("SELECT * FROM `order`")->fetch(PDO::FETCH_ASSOC));
Copy Clear