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
Share      Blog   Popular

PHPize.online is a free online environment for quickly running, experimenting with and sharing PHP (including Carbon extension for DateTime) and SQL code. You can run your SQL code with PHP code that can use the same DB. For database manipulations you can use pre-defined instances of PDO ($pdo), mysqli ($mysqli) & Laravel query builder ($db)

Copy Format Clear
Copy Clear
Copy Format Clear
<?php $pdo->query("create table users (id int, name varchar(100))"); $pdo->query("insert into users (id,name) values (1,'Bobby Tables')"); echo $pdo->query("select name from users")->fetchColumn(),"\n"; $id = "id;drop table users"; $stmt = $pdo->prepare("select name from users where id=?"); $stmt->execute([$id]); $id = mysqli_real_escape_string($mysqli, $id); $stmt = $pdo->query("select name from users where id=$id"); echo $pdo->query("select name from users")->fetchColumn(),"\n";
Show:  
Copy Clear