dimanche 27 septembre 2015

Laravel Query Builder - Error for using NOW() and DateFormat

I have a MySQL table like this-

enter image description here

And a query builder of Laravel like this-

    $baseQuery = DB::table('webinars')
        ->select(
                    'id',
                    'title',
                    'description',
                    'hosts',
                    DB::raw('concat(DATE_FORMAT(starts_on,"%d %b %Y %h:%i %p), " ", timezone) as starts'),
                    'duration',
                    'created_at'
                )
        ->where('user_id', '=', $user_ID)
        ->where('starts_on >= NOW()');

So, I am getting error for this 2 line-

        DB::raw('concat(DATE_FORMAT(starts_on,"%d %b %Y %h:%i %p), " ", timezone) as starts')

And

        ->where('starts_on >= NOW()');

Error is -

enter image description here

Can anyone help me please?



from Newest questions tagged laravel-5 - Stack Overflow http://ift.tt/1iUjzrN
via IFTTT

Aucun commentaire:

Enregistrer un commentaire