Reputation: 1
i try to handle exception and write code as follows but i also get exception when document save sucessfully in my databse.
$table = "MyRequestTable";
$smsID = new MongoId();
$data = array("_id" => $smsID,
"requestUserid" => 2500,
"requestDate" => new MongoDate(strtotime(date('Y-m-d H:i:s'))),
"requestNosSms" => 1
);
try
{
$result = $table->insert($data, array("safe" => TRUE));
echo $smsID ;
}
catch (Exception $e)
{
echo $e->getMessage();
}
i got following exception "Invalid modifier specified: $push"
Upvotes: 0
Views: 1246
Reputation: 10686
Even if INSERT
command executed correct may be situation when some other instruction throws exception. Are you sure that other parts of code are correct?
Upvotes: 2