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 persons ( id int primary key, name varchar(64), age tinyint ); insert into persons values (10, 'Alice', 18), (20, 'Bob', 22);

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

Copy Clear
Copy Format Clear
<?php $result = $mysqli->query("SELECT name, age FROM persons"); $name = $result->fetch_column(0); $age = $result->fetch_column(1); printf("Name: %s, age: %d", $name, $age);
Copy Clear