Zen Cart™ makes no warranty as to the safety of scripts supplied by 3rd-party contributors. Test before using on your live database!');
define('TEXT_QUERY_RESULTS','Query Results:');
define('TEXT_ENTER_QUERY_STRING','Enter the query
to be executed:
Be sure to
end with ;');
define('TEXT_QUERY_FILENAME','Upload file:');
define('ERROR_NOTHING_TO_DO','Error: Nothing to do - no query or query-file specified.');
define('TEXT_CLOSE_WINDOW', '[ close window ]');
define('SQLPATCH_HELP_TEXT','The SQLPATCH tool lets you install system patches by pasting SQL code directly into the textarea '.
'field here, or by uploading a supplied script (.SQL) file.
' .
'When preparing scripts to be used by this tool, DO NOT include a table prefix, as this tool will ' .
'automatically insert the required prefix for the active database, based on settings in the store\'s ' .
'admin/includes/configure.php file (DB_PREFIX definition).
' .
'The commands entered or uploaded may only begin with the following statements, and MUST be in UPPERCASE:'.
'
- DROP TABLE IF EXISTS
- CREATE TABLE
- INSERT INTO
- INSERT IGNORE INTO
- ALTER TABLE
' .
'- UPDATE (just a single table)
- UPDATE IGNORE (just a single table)
- DELETE FROM
- DROP INDEX
- CREATE INDEX
' .
'
- SELECT
' .
'Advanced Methods
The following methods can be used to issue more complex statements as necessary:
To run some blocks of code together so that they are treated as one command by MySQL, you need the "#NEXT_X_ROWS_AS_ONE_COMMAND:xxx" value set. The parser will then treat X number of commands as one.
If you are running this file thru phpMyAdmin or equivalent, the "#NEXT..." comment is ignored, and the script will process fine.
NOTE: SELECT.... FROM... and LEFT JOIN statements need the "FROM" or "LEFT JOIN" to be on a line by itself in order for the parse script to add the table prefix.
Examples:
#NEXT_X_ROWS_AS_ONE_COMMAND:4
SET @t1=0;
SELECT (@t1:=configuration_value) as t1
FROM configuration
WHERE configuration_key = \'KEY_NAME_HERE\';
UPDATE product_type_layout SET configuration_value = @t1 WHERE configuration_key = \'KEY_NAME_TO_CHECK_HERE\';
DELETE FROM configuration WHERE configuration_key = \'KEY_NAME_HERE\';
- #NEXT_X_ROWS_AS_ONE_COMMAND:1
INSERT INTO tablename
(col1, col2, col3, col4)
SELECT col_a, col_b, col_3, col_4
FROM table2;
- #NEXT_X_ROWS_AS_ONE_COMMAND:1
INSERT INTO table1
(col1, col2, col3, col4 )
SELECT p.othercol_a, p.othercol_b, po.othercol_c, pm.othercol_d
FROM table2 p, table3 pm
LEFT JOIN othercol_f po
ON p.othercol_f = po.othercol_f
WHERE p.othercol_f = pm.othercol_f;
' );
define('REASON_TABLE_ALREADY_EXISTS','Cannot create table %s because it already exists');
define('REASON_TABLE_DOESNT_EXIST','Cannot drop table %s because it does not exist.');
define('REASON_TABLE_NOT_FOUND','Cannot execute because table %s does not exist.');
define('REASON_CONFIG_KEY_ALREADY_EXISTS','Cannot insert configuration_key "%s" because it already exists');
define('REASON_COLUMN_ALREADY_EXISTS','Cannot ADD column %s because it already exists.');
define('REASON_COLUMN_DOESNT_EXIST_TO_DROP','Cannot DROP column %s because it does not exist.');
define('REASON_COLUMN_DOESNT_EXIST_TO_CHANGE','Cannot CHANGE column %s because it does not exist.');
define('REASON_PRODUCT_TYPE_LAYOUT_KEY_ALREADY_EXISTS','Cannot insert prod-type-layout configuration_key "%s" because it already exists');
define('REASON_INDEX_DOESNT_EXIST_TO_DROP','Cannot drop index %s on table %s because it does not exist.');
define('REASON_PRIMARY_KEY_DOESNT_EXIST_TO_DROP','Cannot drop primary key on table %s because it does not exist.');
define('REASON_INDEX_ALREADY_EXISTS','Cannot add index %s to table %s because it already exists.');
define('REASON_PRIMARY_KEY_ALREADY_EXISTS','Cannot add primary key to table %s because a primary key already exists.');
define('REASON_NO_PRIVILEGES','User '.DB_SERVER_USERNAME.'@'.DB_SERVER.' does not have %s privileges to database '.DB_DATABASE.'.');
?>