3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $user_name = "u393257285_fs"; $password = "drapal"; $database = "u393257285_fs"; $server = "mysql.hostinger.in"; $db_handle = mysql_connect($server, $user_name, $password); $db_found = mysql_select_db($database, $db_handle); if ($db_found) { $SQL = "INSERT INTO Test (Id, Name, Age) VALUES (1, 'gates', 60)"; $result = mysql_query($SQL); mysql_close($db_handle); print "Records added to the database"; } else { print "Database NOT Found "; mysql_close($db_handle); } ?>
Output for 7.0.0 - 7.2.0
Fatal error: Uncaught Error: Call to undefined function mysql_connect() in /in/Jk0IX:8 Stack trace: #0 {main} thrown in /in/Jk0IX on line 8
Process exited with code 255.
Output for 5.0.0 - 5.6.28
Fatal error: Call to undefined function mysql_connect() in /in/Jk0IX on line 8
Process exited with code 255.
Output for 4.3.2 - 4.4.9
Warning: mysql_connect(): Unknown MySQL Server Host 'mysql.hostinger.in' (11) in /in/Jk0IX on line 8 Warning: mysql_select_db(): supplied argument is not a valid MySQL-Link resource in /in/Jk0IX on line 9 Database NOT Found Warning: mysql_close(): supplied argument is not a valid MySQL-Link resource in /in/Jk0IX on line 25
Output for 4.3.0 - 4.3.1
Warning: mysql_connect() [http://www.php.net/function.mysql-connect]: Unknown MySQL Server Host 'mysql.hostinger.in' (11) in /in/Jk0IX on line 8 Warning: mysql_select_db(): supplied argument is not a valid MySQL-Link resource in /in/Jk0IX on line 9 Database NOT Found Warning: mysql_close(): supplied argument is not a valid MySQL-Link resource in /in/Jk0IX on line 25