3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<? $verbindung = mysql_connect ('rdbms.strato.de', 'U922826', 'peru1999!') or die ("Keine Verbindung zur Datenbank möglich. Benutzername oder Passwort sind falsch!"); mysql_select_db('DB922826') or die ("Die Datenbank existiert nicht."); /* MySQL Verbindungsscript end */ define('DB', '1'); //MYSQLI Verbindung zur Datenbank $mysqli = mysqli_connect("rdbms.strato.de", "U922826", "peru1999!", "DB922826"); /* check connection */ if (mysqli_connect_errno()) { printf("Connect failed: %s\n", mysqli_connect_error()); exit(); } //printf("Initial character set: %s\n", mysqli_character_set_name($mysqli)); if (!mysqli_set_charset($mysqli, "utf8")) { printf("Error loading character set utf8: %s\n", mysqli_error($mysqli)); exit(); } ?>
based on 6EaiI
Output for 7.0.0 - 7.2.0
Fatal error: Uncaught Error: Call to undefined function mysql_connect() in /in/InJGa:2 Stack trace: #0 {main} thrown in /in/InJGa on line 2
Process exited with code 255.
Output for 5.4.0 - 5.6.28
Fatal error: Call to undefined function mysql_connect() in /in/InJGa on line 2
Process exited with code 255.
Output for 4.3.0 - 5.3.29
<? $verbindung = mysql_connect ('rdbms.strato.de', 'U922826', 'peru1999!') or die ("Keine Verbindung zur Datenbank möglich. Benutzername oder Passwort sind falsch!"); mysql_select_db('DB922826') or die ("Die Datenbank existiert nicht."); /* MySQL Verbindungsscript end */ define('DB', '1'); //MYSQLI Verbindung zur Datenbank $mysqli = mysqli_connect("rdbms.strato.de", "U922826", "peru1999!", "DB922826"); /* check connection */ if (mysqli_connect_errno()) { printf("Connect failed: %s\n", mysqli_connect_error()); exit(); } //printf("Initial character set: %s\n", mysqli_character_set_name($mysqli)); if (!mysqli_set_charset($mysqli, "utf8")) { printf("Error loading character set utf8: %s\n", mysqli_error($mysqli)); exit(); } ?>