How to get mysqli working with DELIMITERs in SQL statements?

后端 未结 1 1355
眼角桃花
眼角桃花 2021-01-06 17:48

I\'m using mysqli and trying now to get a view from an SQL code snippet (generated by MySQL Workbench) into a database.

$query = <<

        
1条回答
  •  傲寒
    傲寒 (楼主)
    2021-01-06 18:09

    This is the source that helped me understand this... http://zend-framework-community.634137.n4.nabble.com/Problems-changing-the-sql-end-of-statement-delimiter-tp2124060p2124276.html

    DELIMITER is not an actual MySQL Statement.

    I believe it is just something that some MySQL clients have implemented to help shipping a bunch of sql statements at the same time.

    mysqli driver does not implement this functionality.

    So, this should work.

    $query = <<

    I ran into the same problem, with the same mysqli driver, with multi_query function (using delimiters while creating procedures) and removing the DELIMITER from my SQL worked.

    0 讨论(0)
提交回复
热议问题