Documentation Plugin SQL Installation
ZC 1.5.7
Trying to write a new plugin. I have a few questions re the SQL installer Class and how to write one if i need to.
The current version of zen cart reports errors if you use multi line SQL for use in install sql patch in zen cart admin. so
Does the new installer method use the same validation and have the same requirements for multi line sql as the install sql patch in admin? e.g.
I want to run the following Query
Code:
INSERT IGNORE INTO products_location (products_id, products_location)
SELECT products_id,"" FROM products ;
to cope with the select from products in the insert it needs to be on a new line.
Is this still true if I just use straight sql for the install and will it still produce the same erroneous error message?
You quote in the documentation an example of how to create an installer class. However there is no link to the plugin. When I look at the plugins i can find the one quoted but is does not use the installer class. Does the example exist? if so can i see it? It may be easier to code a sql installer than it is to correct the issue above.
Re: Documentation Plugin SQL Installation
Quote:
Originally Posted by
brittainmark
ZC 1.5.7
The current version of zen cart reports errors if you use multi line SQL for use in install sql patch in zen cart admin. so
... if I just use straight sql for the install and will it still produce the same erroneous error message?
What "erroneous error message" are you referring to?
Are you referring to this issue that was fixed? Re: [Done v157a] Spurious error message Query incomplete: missing closing semicolon.
Re: Documentation Plugin SQL Installation
Yes just seen 1.5.7a.
Unfortunately it was not fixed now get error as it is no longer capable of processing multi line sql statements if you have a prefix present!
Re: Documentation Plugin SQL Installation
My above statement is not true. It works fin I had double spaces in my query that cause the issues.
So I assume that it uses the same module.
If i want to write a sql installer class is it as simple as creating the install and uninstall functions and putting what i need in them?
Re: Documentation Plugin SQL Installation
The inbuilt DisplayLogs plugin contains an example of using an Installer Class
e.g. zc_plugins/DisplayLogs/v3.0.0/Installer/ScriptedInstaller.php