php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #54211 delimiter ends with syntax error
Submitted: 2011-03-10 08:50 UTC Modified: 2011-03-11 04:49 UTC
From: svecpetr at svecpetr dot com Assigned:
Status: Not a bug Package: MySQL related
PHP Version: 5.2.17 OS: linux
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: svecpetr at svecpetr dot com
New email:
PHP Version: OS:

 

 [2011-03-10 08:50 UTC] svecpetr at svecpetr dot com
Description:
------------
in mysql_query is impossible to execute command

DELIMITER |

for example mysql_query('DELIMITER |');
this ends with mysql syntax error 1064

... when delimiter is not function... is impossible to run command CREATE TRIGGER because at the end of this command is always ... ; END ...



---
From manual page: http://www.php.net/function.mysql-query#Description
---


Test script:
---------------
mysql_query('DELIMITER |');
mysql_query('SHOW TABLES|');
mysql_query('DELIMITER ;');

Expected result:
----------------
enable delimiter


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2011-03-10 17:21 UTC] carsten_sttgt at gmx dot de
> in mysql_query is impossible to execute command
> DELIMITER |

"delimiter" is a command for the command line client and not a SQL statement known by the server.

> ... when delimiter is not function... is impossible to run command
> CREATE TRIGGER because at the end of this command is always ... ; END ...

Just create your trigger (including BEGIN ...; END) as usual, should work. As always with querys in PHP, no ";" at the end of the query string.
 [2011-03-11 04:49 UTC] aharvey@php.net
-Status: Open +Status: Bogus
 [2011-03-11 04:49 UTC] aharvey@php.net
I think Carsten has pretty much nailed this one. Closing.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Wed Apr 24 20:01:32 2024 UTC