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 if ($db->connect_errno > 0) { die('Connect Error: ' . mysqli_connect_errno()); } echo 'Greetings! Connected to the MyAddressBook Database!'; $sql = "SELECT id, f_name,l_name,address,city,state,zip,phone FROM LAB7_3823.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/3823/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/3823/delete.php ?id={$r->id}"; $insert = "http://devry.edupe.net/3823/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> Warning: Undefined variable $db in /in/O8HXc on line 12 Warning: Attempt to read property "connect_errno" on null in /in/O8HXc on line 12 Greetings! Connected to the MyAddressBook Database! Warning: Undefined variable $db in /in/O8HXc on line 19 Fatal error: Uncaught Error: Call to a member function query() on null in /in/O8HXc:19 Stack trace: #0 {main} thrown in /in/O8HXc on line 19
Process exited with code 255.
Output for 7.2.0 - 7.2.33, 7.3.0 - 7.3.31, 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> Notice: Undefined variable: db in /in/O8HXc on line 12 Notice: Trying to get property 'connect_errno' of non-object in /in/O8HXc on line 12 Greetings! Connected to the MyAddressBook Database! Notice: Undefined variable: db in /in/O8HXc on line 19 Fatal error: Uncaught Error: Call to a member function query() on null in /in/O8HXc:19 Stack trace: #0 {main} thrown in /in/O8HXc on line 19
Process exited with code 255.
Output for 7.3.32 - 7.3.33
<!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>Index</title> </head> <body> Greetings! Connected to the MyAddressBook Database! Fatal error: Uncaught Error: Call to a member function query() on null in /in/O8HXc:19 Stack trace: #0 {main} thrown in /in/O8HXc on line 19
Process exited with code 255.
Output for 7.0.5 - 7.0.33, 7.1.0 - 7.1.33
<!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>Index</title> </head> <body> Notice: Undefined variable: db in /in/O8HXc on line 12 Notice: Trying to get property of non-object in /in/O8HXc on line 12 Greetings! Connected to the MyAddressBook Database! Notice: Undefined variable: db in /in/O8HXc on line 19 Fatal error: Uncaught Error: Call to a member function query() on null in /in/O8HXc:19 Stack trace: #0 {main} thrown in /in/O8HXc on line 19
Process exited with code 255.
Output for 7.0.0 - 7.0.4
<!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>Index</title> </head> <body> Notice: Undefined variable: db in /in/O8HXc on line 12 Notice: Trying to get property of non-object in /in/O8HXc on line 12 Greetings! Connected to the MyAddressBook Database! Notice: Undefined variable: db in /in/O8HXc on line 19 Fatal error: Uncaught Error: Call to a member function query() on unknown in /in/O8HXc:19 Stack trace: #0 {main} thrown in /in/O8HXc on line 19
Process exited with code 255.
Output for 5.6.0 - 5.6.40
<!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>Index</title> </head> <body> Notice: Undefined variable: db in /in/O8HXc on line 12 Notice: Trying to get property of non-object in /in/O8HXc on line 12 Greetings! Connected to the MyAddressBook Database! Notice: Undefined variable: db in /in/O8HXc on line 19 Fatal error: Call to a member function query() on null in /in/O8HXc on line 19
Process exited with code 255.
Output for 5.0.4 - 5.0.5, 5.1.0 - 5.1.6, 5.2.0 - 5.2.17, 5.3.0 - 5.3.29, 5.4.0 - 5.4.45, 5.5.0 - 5.5.38
<!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>Index</title> </head> <body> Notice: Undefined variable: db in /in/O8HXc on line 12 Notice: Trying to get property of non-object in /in/O8HXc on line 12 Greetings! Connected to the MyAddressBook Database! Notice: Undefined variable: db in /in/O8HXc on line 19 Fatal error: Call to a member function query() on a non-object in /in/O8HXc on line 19
Process exited with code 255.
Output for 5.0.0 - 5.0.3
<!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>Index</title> </head> <body> Notice: Undefined variable: db in /in/O8HXc on line 12 Notice: Trying to get property of non-object in /in/O8HXc on line 12 Greetings! Connected to the MyAddressBook Database! Notice: Undefined variable: db in /in/O8HXc on line 19 Fatal error: Call to a member function query() on a non-object in /in/O8HXc on line 19
Process exited with code 255.
Output for 4.3.2 - 4.3.11, 4.4.0 - 4.4.9
<!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>Index</title> </head> <body> Notice: Undefined variable: db in /in/O8HXc on line 12 Greetings! Connected to the MyAddressBook Database! Fatal error: Call to a member function on a non-object in /in/O8HXc on line 19
Process exited with code 255.
Output for 4.3.0 - 4.3.1
<!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>Index</title> </head> <body> Notice: Undefined variable: db in /in/O8HXc on line 12 Greetings! Connected to the MyAddressBook Database! Fatal error: Call to a member function on a non-object in /in/O8HXc on line 19

preferences:
301.04 ms | 402 KiB | 461 Q