3v4l.org

run code in 300+ PHP versions simultaneously
<?php define("DB_HOST", "www.sql2.webzdarma.cz"); define("DB_USER", "taxidiary.wz6133"); define("DB_PASSWORD", "v6ir53b3"); define("DB_DATABASE", "taxidiary.wz6133"); $conn = mysql_connect(DB_HOST, DB_USER, DB_PASSWORD); if(!mysql_select_db(DB_DATABASE)) { print "Připojení k DB selhalo..."; } $selected_db = mysql_select_db("jizdy", $conn); if(!$selefcted_db) { echo "DB not found"; } function store_drive($from, $to, $price) { $date = date("Y-n-d H:i:s"); $result = mysql_query("INSERT INTO jizdy(odkud, kam, cena, datum) VALUES('".$from."','".$to."','".$price."','".$date."')"); } if(isset($POST['submit'])) { $from = isset($POST['from']) ? $POST['from'] :""; $to = isset($POST['to']) ? $POST['to'] :""; $price = isset($POST['price']) ? $POST['price'] :""; if(isset($POST['price'])) { store_drive($from, $to, $price); } } function get_week() { $date = date("Y-n-d"); $result = mysql_query("SELECT * FROM jizdy WHERE datum >= '$date'"); $rows = mysql_num_rows($result); while($row = mysql_fetch_array($rows, MYSQL_ASSOC)) { print("<tr> <td>".$row['odkud']."</td> <td>".$row['kam']."</td> <td>".$row['cena']."</td> <td>".$row['datum']."</td> </tr>"); } }
Output for git.master, git.master_jit, rfc.property-hooks
Fatal error: Uncaught Error: Call to undefined function mysql_connect() in /in/jZoa7:8 Stack trace: #0 {main} thrown in /in/jZoa7 on line 8
Process exited with code 255.

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
40.83 ms | 401 KiB | 8 Q