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 locations ( location_id INT AUTO_INCREMENT, owner VARCHAR(100), PRIMARY KEY (location_id) ); INSERT INTO locations(owner) VALUES ('Potato Fun'), ('Potato Gun'), ('Potato Pun'), ('Potato Sun');

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

Copy Clear
Copy Format Clear
<?php // $mysqli is already declared as a working database connection by this sandbox var_export( $mysqli->execute_query("SELECT * FROM locations WHERE location_id = ?", [2])->fetch_assoc() );
Copy Clear