I am new to the Slim Framework. I don't know how to perform an insert query in Slim framework.
Please can somebody show me an example or tutorial to understand it better. I have read the Android hive tutorial but am still not clear.
I am not able to post the params when using advanced REST API.
0 Response is generated.
Below is my code for index.php
file:
global $name;
$app->get('/saveEvent', function() {
global $user_id;
$response = array();
$db = new DbHandler();
$name = $app->request->post('name');
$result = $db->createUser($name);
//$response["error"] = false;
if ($result != NULL) {
$response["error"] = false;
$response["message"] = "Task created successfully";
} else {
$response["error"] = true;
$response["message"] = "Failed to create task. Please try again";
}
echoRespnse(201, $response);
});
$app->run();
Here is an example of how you would perform a post: