PHPize Online / SQLize Online  /  SQLtest Online

A A A
Share      Blog   Popular
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);
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);
Show:  
Copy Clear