3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $con = mysql_connect("localhost","root","0203199318"); mysql_select_db("kimchipop_data",$con); $sql = "SELECT * FROM featured_posts"; $result = mysql_query($sql, $con); while ($record = mysql_fetch_array($result)){ echo $record['title'] . " " . $record['type'] . " " . $record['caption']; echo "<br></br>"; } ?>
Output for 7.0.0 - 7.1.0
Fatal error: Uncaught Error: Call to undefined function mysql_connect() in /in/JbLWC:4 Stack trace: #0 {main} thrown in /in/JbLWC on line 4
Process exited with code 255.
Output for hhvm-3.10.0 - 3.13.2
Warning: mysql_connect(): Can't connect to local MySQL server through socket '/run/mysqld/mysqld.sock' (2) in /in/JbLWC on line 4 Warning: mysql_select_db() expects parameter 2 to be resource, boolean given in /in/JbLWC on line 6 Warning: mysql_query() expects parameter 2 to be resource, boolean given in /in/JbLWC on line 10 Warning: mysql_fetch_array() expects parameter 1 to be resource, null given in /in/JbLWC on line 12
Output for 5.0.0 - 5.6.28
Fatal error: Call to undefined function mysql_connect() in /in/JbLWC on line 4
Process exited with code 255.
Output for 4.3.2 - 4.4.9
Warning: mysql_connect(): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2) in /in/JbLWC on line 4 Warning: mysql_select_db(): supplied argument is not a valid MySQL-Link resource in /in/JbLWC on line 6 Warning: mysql_query(): supplied argument is not a valid MySQL-Link resource in /in/JbLWC on line 10 Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /in/JbLWC on line 12
Output for 4.3.0 - 4.3.1
Warning: mysql_connect() [http://www.php.net/function.mysql-connect]: Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2) in /in/JbLWC on line 4 Warning: mysql_select_db(): supplied argument is not a valid MySQL-Link resource in /in/JbLWC on line 6 Warning: mysql_query(): supplied argument is not a valid MySQL-Link resource in /in/JbLWC on line 10 Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /in/JbLWC on line 12