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

تعليقات

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

5 Free Black and White Social Media Icons Sets with CSS and HTML

How to Create Treeview with Bootstrap and jQuery

How to Change Apache and MySQL Port Number in XAMPP Localhost