# Need Help on Post Method

**URL:** <https://discourse.slimframework.com/t/need-help-on-post-method/1611>\
**Category:** Questions\
**Created:** [June 23, 2017, 8:01am UTC](https://discourse.slimframework.com/t/need-help-on-post-method/1611 "2017-06-23T08:01:26Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![mskian](https://avatars.discourse-cdn.com/v4/letter/m/8797f3/32.png) [@mskian](https://discourse.slimframework.com/u/mskian)\
**Post date:** [June 23, 2017, 8:01am UTC](https://discourse.slimframework.com/t/need-help-on-post-method/1611/1 "2017-06-23T08:01:26Z")

</div>

Hi I am facing some issues on Post Method

My code

```auto
function signup() {
$request = \Slim\Slim::getInstance()->request();
$update = json_decode($request->getBody()); 
$sql = "INSERT INTO updates (title,link) VALUES (:title, :link)";
try {

$db = getDB();
$stmt = $db->prepare($sql); 
$stmt->bindParam("title", $update->title);
$stmt->bindParam("link", $update->link);
$time=time();
$stmt->execute();
$update->id = $db->lastInsertId();
$db = null;
echo json_encode($update);
}
catch(PDOException $e) {
echo '{"error":{"text":'. $e->getMessage() .'}}';
}
}
```

it saved as null on database and json result Null (Using Postman) Status getting 200

---

<div class="post-metadata">

**Author:** ![damianopetrungaro](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.slimframework.com/damianopetrungaro/32/236_2.png) [@damianopetrungaro](https://discourse.slimframework.com/u/damianopetrungaro)\
**Post date:** [June 23, 2017, 8:57am UTC](https://discourse.slimframework.com/t/need-help-on-post-method/1611/2 "2017-06-23T08:57:08Z")

</div>

Why are you using a function where inside try get an instance of Slim and handle the useCase?

Anyway, i have never seen the getInstance() method on Slim 3. Are you using Slim2?

Can you try to see what’s inside the $request and $update variables?
