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

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

Copy Clear
Copy Format Clear
<?php include 'config.php'; echo "Connected using MySQLi<br>"; $sql = "SELECT * FROM students"; $result = mysqli_query($mysql, $sql); if (mysqli_num_rows($result) > 0) { while ($row = mysqli_fetch_assoc($result)) { echo $row['id'] . " - " . $row['name'] . "<br>"; } } else { echo "No records found."; } mysqli_close($mysql); ?>
Copy Clear