3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php // Conectando, seleccionando la base de datos $link = mysql_connect('mysql3.000webhost.com', 'a7163469_intern', '11Liburu') or die('No se pudo conectar: ' . mysql_error()); echo 'Connected successfully'; mysql_select_db('a7163469_txanda') or die('No se pudo seleccionar la base de datos'); // Realizar una consulta MySQL $query = 'SELECT * FROM Txanda'; $result = mysql_query($query) or die('Consulta fallida: ' . mysql_error()); // Imprimir los resultados en HTML echo "<table>\n"; while ($line = mysql_fetch_array($result, MYSQL_ASSOC)) { echo "\t<tr>\n"; foreach ($line as $col_value) { echo "\t\t<td>$col_value</td>\n"; } echo "\t</tr>\n"; } echo "</table>\n"; // Liberar resultados mysql_free_result($result); // Cerrar la conexión mysql_close($link); ?>
based on mJQa6
Output for 7.0.0 - 7.2.0
Fatal error: Uncaught Error: Call to undefined function mysql_connect() in /in/pEM7N:3 Stack trace: #0 {main} thrown in /in/pEM7N on line 3
Process exited with code 255.
Output for 5.0.0 - 5.6.28
Fatal error: Call to undefined function mysql_connect() in /in/pEM7N on line 3
Process exited with code 255.
Output for 4.3.2 - 4.4.9
Warning: mysql_connect(): Unknown MySQL Server Host 'mysql3.000webhost.com' (0) in /in/pEM7N on line 3 No se pudo conectar: Unknown MySQL Server Host 'mysql3.000webhost.com' (0)
Output for 4.3.0 - 4.3.1
Warning: mysql_connect() [http://www.php.net/function.mysql-connect]: Unknown MySQL Server Host 'mysql3.000webhost.com' (0) in /in/pEM7N on line 3 No se pudo conectar: Unknown MySQL Server Host 'mysql3.000webhost.com' (0)