3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php function deleteActivity() { $response = array(); if (isset($_POST["aid"])) { $aid = intval($_POST["aid"]); $query = "DELETE FROM Activities WHERE ActivityID = '$aid';"; $result = mysql_query($query) or die(mysql_error()); if ($result) { $response["error"] = false; $response["message"] = "Activity deleted successfully!"; } else { $response["error"] = true; $response["message"] = "Failed to deleted activity!"; } } else { $response["error"] = true; $response["message"] = "Things are missing!"; } // echo json response echo json_encode($response); } ?>
Output for 4.3.0 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0