Last active
March 27, 2017 17:22
-
-
Save itswadesh/f32eb297f2f0a8ab573a2294d249e4db to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
require_once '../includes/db.php'; // The mysql database connection script | |
if(isset($_GET['task'])){ | |
$task = $_GET['task']; | |
$status = "0"; | |
$created = time(); | |
$query="INSERT INTO tasks(task,status,created_at) VALUES ('$task', '$status', '$created')"; | |
$result = $mysqli->query($query) or die($mysqli->error.__LINE__); | |
$result = $mysqli->affected_rows; | |
echo $json_response = json_encode($result); | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment