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 `test` (id int); INSERT INTO `test` (id) VALUES (1234), (1), (2); CREATE TABLE `test2` (id int); INSERT INTO `test2` (id) VALUES (1234), (1), (2);

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

Copy Clear
Copy Format Clear
<?php $query = "SELECT * FROM test T INNER JOIN test2 T2 on T.id = T2.id where T.id = :eventID"; // get DB version using PDO $stmt = $pdo->prepare($query); $stmt->execute([':eventID' => 1234]); $row = $stmt->fetch(PDO::FETCH_ASSOC); var_dump($row);
Copy Clear