Laravel 5 DB::statement return SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the

Here is statement:

CREATE TEMPORARY TABLE homestead.temp_table
AS
SELECT title,content, feed, link, date, created_at, updated_at FROM homestead.news ORDER BY `date` ASC LIMIT 5;

TRUNCATE homestead.news;

INSERT INTO homestead.news (title, content, feed, link, date, created_at, updated_at)
SELECT title, content, feed, link, date, created_at, updated_at FROM homestead.temp_table;

DROP TEMPORARY TABLE homestead.temp_table;

Code is working in Mysql Workbench but not inside laravel. Please help, this is my first question on Stackoverflow :)



from Newest questions tagged laravel-5 - Stack Overflow https://ift.tt/3kT0mcY
via IFTTT

تعليقات

المشاركات الشائعة من هذه المدونة

How to Create Treeview with Bootstrap and jQuery

jQuery Datatables with PHP, MySQL and AJAX Example

How to Add Images to Dropdown List using jQuery