Hi! Could we please enable some services and cookies to improve your experience and our website?

PHPize | SQLize | SQLtest

Online Sandbox for SQL and PHP: Write, Run, Test, and Share SQL Queries and PHP Code

A A A
Login    Share code      Blog   FAQ
Copy Format Clear

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

Copy Clear
Copy Format Clear
<?php $conn = $mysqli; // SQL query to select all data from the table $sql = "SELECT * FROM structure_ranks"; // Fetch all rows from the result set and store them in the array $result = $conn->query($sql)->fetch_all(MYSQLI_ASSOC); // Output the array as JSON echo json_encode($array, JSON_PRETTY_PRINT);
Copy Clear