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 mytable ( field1 int, field2 int, field3 int, field4 int, field5 int, field6 int, field7 int, field8 int, field9 int ); INSERT INTO mytable VALUES (1, 2, 3, 4, 5, 6, 7, 8, 9);

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

Copy Clear
Copy Format Clear
<?php $query = "SELECT * FROM `mytable` "; $queryResult = $mysqli->query($query); $MyListArray = $queryResult->fetch_all(MYSQLI_ASSOC); print_r($MyListArray); $MyListArray = []; $queryResult = $mysqli->query($query); while ($row = $queryResult->fetch_assoc()) { $MyListArray[] = $row; }; print_r($MyListArray);
Copy Clear