samedi 24 juillet 2021

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 :)



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire