Reputation: 29
I can not get the result of such a request:
$performance = DB::select("SELECT ROUND(TIME_TO_SEC(timediff(NOW(), date_finish))/60) FROM tickets WHERE id = ?", [$id]);
the result comes in the form of an array:
array:1 [
0 => {#1385
+"ROUND(TIME_TO_SEC(timediff(NOW(), date_finish))/60)": "299"
}
]
Upvotes: 0
Views: 303
Reputation: 71
Thats becouse your not included get()
in end of your code.
Replace this:
$performance = DB::select("SELECT ROUND(TIME_TO_SEC(timediff(NOW(), date_finish))/60) FROM tickets WHERE id = ?", [$id])->get();
with this:
$performance = DB::select("SELECT ROUND(TIME_TO_SEC(timediff(NOW(), date_finish))/60) FROM tickets WHERE id = ?", [$id]);
Upvotes: 2