3v4l.org

run code in 300+ PHP versions simultaneously
<?php $dbname = ''; $dbuser = 'barry'; $dbpass = 'Barry123$'; $dbhost = 'mysql://thrive-lms.cgbwgdsqerhj.ap-southeast-2.rds.amazonaws.com'; $connect = mysql_connect($dbhost, $dbuser, $dbpass) or die("Unable to Connect to '$dbhost'"); mysql_select_db($dbname) or die("Could not open the db '$dbname'"); $test_query = "SHOW TABLES FROM $dbname"; $result = mysql_query($test_query); $tblCnt = 0; while($tbl = mysql_fetch_array($result)) { $tblCnt++; } if (!$tblCnt) { echo "There are no tables<br />n"; } else { echo "There are $tblCnt tables<br />n"; } ?>
Output for 7.0.0 - 7.0.20, 7.1.0 - 7.1.25, 7.2.0 - 7.2.33, 7.3.0 - 7.3.33, 7.4.0 - 7.4.33, 8.0.0 - 8.0.30, 8.1.0 - 8.1.28, 8.2.0 - 8.2.18, 8.3.0 - 8.3.6
Fatal error: Uncaught Error: Call to undefined function mysql_connect() in /in/eZGhl:7 Stack trace: #0 {main} thrown in /in/eZGhl on line 7
Process exited with code 255.
Output for 5.4.1 - 5.4.45, 5.5.24 - 5.5.35, 5.6.8 - 5.6.28
Fatal error: Call to undefined function mysql_connect() in /in/eZGhl on line 7
Process exited with code 255.

preferences:
191.79 ms | 402 KiB | 242 Q