3v4l.org

run code in 300+ PHP versions simultaneously
<!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>Index</title> </head> <body> <?php $db = new mysqli('127.0.0.1', '3274', 'hisham1234', 'week7_ilab4_3274'); if ($db->connect_errno > 0) { die('Connect Error: ' . mysqli_connect_errno()); } echo 'Greetings! Connected to the My Address Book Database!'; $sql = "SELECT id,f_name,l_name,address,city,state,zip,phone FROM myaddressbook"; $result_db = $db->query($sql) or die('Error perform query!'); ?> <table border="1"> <tr> <th>ID</th> <th>First Name</th> <th>Last Name</th> <th>Address</th> <th>City</th> <th>State</th> <th>Zip</th> <th>Phone</th> </tr> <?php while ($r = $result_db->fetch_object()) { $update = "http://devry.edupe.net/~3274/update_data.php ?id={$r->id}&f_name={$r->f_name}&l_name={$r->l_name}&address={$r->address}&state={$r->state}&city={$r->city}&zip={$r->zip}&phone=$r->phone"; $delete = "http://devry.edupe.net/~3274/delete.php ?id={$r->id}"; $insert = "http://devry.edupe.net/~3274/insert_data.php"; echo '<tr>'; echo '<td>' . $r->id . '</td>'; echo '<td>' . $r->f_name . '</td>'; echo '<td>' . $r->l_name . '</td>'; echo '<td>' . $r->address . '</td>'; echo '<td>' . $r->city . '</td>'; echo '<td>' . $r->state . '</td>'; echo '<td>' . $r->zip . '</td>'; echo '<td>' . $r->phone . '</td>'; echo "<td><a href='{$update}'>Update</a></td>"; echo "<td><a href='{$delete}'>Delete</a></td>"; echo "<td><a href='{$insert}'>Insert</a></td>"; echo '</tr>'; } $db->close(); ?> </table> </body> </html>
Output for 8.0.0 - 8.0.30, 8.1.0 - 8.1.28, 8.2.0 - 8.2.19, 8.3.0 - 8.3.7
<!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>Index</title> </head> <body> Fatal error: Uncaught Error: Class "mysqli" not found in /in/dFHrL:10 Stack trace: #0 {main} thrown in /in/dFHrL on line 10
Process exited with code 255.
Output for 7.0.0 - 7.0.20, 7.1.0 - 7.1.20, 7.2.0 - 7.2.33, 7.3.16 - 7.3.33, 7.4.0 - 7.4.33
<!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>Index</title> </head> <body> Fatal error: Uncaught Error: Class 'mysqli' not found in /in/dFHrL:10 Stack trace: #0 {main} thrown in /in/dFHrL on line 10
Process exited with code 255.
Output for 5.4.0 - 5.4.45, 5.5.24 - 5.5.35, 5.6.8 - 5.6.28
<!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>Index</title> </head> <body> Fatal error: Class 'mysqli' not found in /in/dFHrL on line 10
Process exited with code 255.

preferences:
165.51 ms | 402 KiB | 230 Q