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 `'user'` (id int); show tables;

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

Copy Clear
Copy Format Clear
<?php $pdo->setAttribute(PDO::ATTR_EMULATE_PREPARES, true); echo json_encode($pdo->query('show tables')->fetchAll(PDO::FETCH_ASSOC)); ; $query = "SELECT * FROM users `:userName`;"; $stmt = $pdo->prepare($query); $stmt->bindValue(":userName", 'user'); $stmt->execute(); $results = $stmt->fetchAll(PDO::FETCH_ASSOC);
Copy Clear