3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?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"; } ?>
based on 0QgMI
Output for 7.0.0 - 7.2.0
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.3.18 - 5.6.28
Fatal error: Call to undefined function mysql_connect() in /in/eZGhl on line 7
Process exited with code 255.