3v4l.org

run code in 300+ PHP versions simultaneously
<?php if (isset($_POST['submit']) && isset($_POST['titel']) && isset($_POST['trainer']) && isset($_POST['ort'])&& isset($_POST['dauer']) && $_POST['titel'] != '' && $_POST['trainer'] != '' && $_POST['ort'] != '' && (int)$_POST['dauer'] > 0) { try { $db = new MySQLi('localhost', 'root', '', 'php'); echo 'Verbindung offen.<br />'; $sql = 'INSERT INTO trainings (titel, trainer, ort, dauer) VALUES (?, ?, ?, ?)'; $kommando = $db->prepare($sql); $kommando->bind_param('sssi', $_POST['titel'], $_POST['trainer'], $_POST['ort'], $dauer); $dauer = (int)$_POST['dauer']; $kommando->execute(); echo 'SQL geschickt. <br />'; echo $kommando->affected_rows . ' Zeilen betroffen. <br />'; $db->close(); echo 'Verbindung zu.<br />'; } catch (Exception $e) { echo 'Fehler: ' . htmlspecialchars($e->getMessage()); } } ?>
Output for git.master, git.master_jit, rfc.property-hooks

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:
43.4 ms | 401 KiB | 8 Q