[ Index ]
 

Code source de Zen Cart E-Commerce Shopping Cart 1.3.7.1

Accédez au Source d'autres logiciels libres

Classes | Fonctions | Variables | Constantes | Tables

title

Body

[fermer]

/admin/includes/languages/english/ -> sqlpatch.php (source)

   1  <?php
   2  //

   3  // +----------------------------------------------------------------------+

   4  // |zen-cart Open Source E-commerce                                       |

   5  // +----------------------------------------------------------------------+

   6  // | Copyright (c) 2006 The zen-cart developers                           |

   7  // |                                                                      |

   8  // | http://www.zen-cart.com/index.php                                    |

   9  // |                                                                      |

  10  // | Portions Copyright (c) 2003 osCommerce                               |

  11  // +----------------------------------------------------------------------+

  12  // | This source file is subject to version 2.0 of the GPL license,       |

  13  // | that is bundled with this package in the file LICENSE, and is        |

  14  // | available through the world-wide-web at the following url:           |

  15  // | http://www.zen-cart.com/license/2_0.txt.                             |

  16  // | If you did not receive a copy of the zen-cart license and are unable |

  17  // | to obtain it through the world-wide-web, please send a note to       |

  18  // | license@zen-cart.com so we can mail you a copy immediately.          |

  19  // +----------------------------------------------------------------------+

  20  //  $Id: sqlpatch.php 4138 2006-08-14 05:56:44Z drbyte $

  21  //

  22    define('HEADING_TITLE','SQL Query Executor');
  23    define('HEADING_WARNING','BE SURE TO DO A FULL DATABASE BACKUP BEFORE RUNNING SCRIPTS HERE');
  24    define('HEADING_WARNING2','If you are installing 3rd-party contributions, note that you do so at your own risk.<br />Zen Cart&trade; makes no warranty as to the safety of scripts supplied by 3rd-party contributors. Test before using on your live database!');
  25    define('HEADING_WARNING_INSTALLSCRIPTS', 'NOTE: Zen Cart database-upgrade scripts should NOT be run from this page.<br />Please upload the new <strong>zc_install</strong> folder and run the upgrade from there instead for better reliability.');
  26    define('TEXT_QUERY_RESULTS','Query Results:');
  27    define('TEXT_ENTER_QUERY_STRING','Enter the query <br />to be executed:&nbsp;&nbsp;<br /><br />Be sure to<br />end with ;');
  28    define('TEXT_QUERY_FILENAME','Upload file:');
  29    define('ERROR_NOTHING_TO_DO','Error: Nothing to do - no query or query-file specified.');
  30    define('TEXT_CLOSE_WINDOW', '[ close window ]');
  31    define('SQLPATCH_HELP_TEXT','The SQLPATCH tool lets you install system patches by pasting SQL code directly into the textarea '.
  32                                'field here, or by uploading a supplied script (.SQL) file.<br />' .
  33                                'When preparing scripts to be used by this tool, DO NOT include a table prefix, as this tool will ' .
  34                                'automatically insert the required prefix for the active database, based on settings in the store\'s ' .
  35                                'admin/includes/configure.php file (DB_PREFIX definition).<br /><br />' .
  36                                'The commands entered or uploaded may only begin with the following statements, and MUST be in UPPERCASE:'.
  37                                '<br /><ul><li>DROP TABLE IF EXISTS</li><li>CREATE TABLE</li><li>INSERT INTO</li><li>INSERT IGNORE INTO</li><li>ALTER TABLE</li>' .
  38                                '<li>UPDATE (just a single table)</li><li>UPDATE IGNORE (just a single table)</li><li>DELETE FROM</li><li>DROP INDEX</li><li>CREATE INDEX</li>' .
  39                                '<br /><li>SELECT </li></ul>' . 
  40  '<h2>Advanced Methods</h2>The following methods can be used to issue more complex statements as necessary:<br />
  41  To run some blocks of code together so that they are treated as one command by MySQL, you need the "<code>#NEXT_X_ROWS_AS_ONE_COMMAND:xxx</code>" value set.  The parser will then treat X number of commands as one.<br />
  42  If you are running this file thru phpMyAdmin or equivalent, the "#NEXT..." comment is ignored, and the script will process fine.<br />
  43  <br /><strong>NOTE: </strong>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.<br /><br />
  44  <em><strong>Examples:</strong></em>
  45  <ul><li><code>#NEXT_X_ROWS_AS_ONE_COMMAND:4<br />
  46  SET @t1=0;<br />
  47  SELECT (@t1:=configuration_value) as t1 <br />
  48  FROM configuration <br />
  49  WHERE configuration_key = \'KEY_NAME_HERE\';<br />
  50  UPDATE product_type_layout SET configuration_value = @t1 WHERE configuration_key = \'KEY_NAME_TO_CHECK_HERE\';<br />
  51  DELETE FROM configuration WHERE configuration_key = \'KEY_NAME_HERE\';<br />&nbsp;</li>
  52  
  53  <li>#NEXT_X_ROWS_AS_ONE_COMMAND:1<br />
  54  INSERT INTO tablename <br />
  55  (col1, col2, col3, col4)<br />
  56  SELECT col_a, col_b, col_3, col_4<br />
  57  FROM table2;<br />&nbsp;</li>
  58  
  59  <li>#NEXT_X_ROWS_AS_ONE_COMMAND:1<br />
  60  INSERT INTO table1 <br />
  61  (col1, col2, col3, col4 )<br />
  62  SELECT p.othercol_a, p.othercol_b, po.othercol_c, pm.othercol_d<br />
  63  FROM table2 p, table3 pm<br />
  64  LEFT JOIN othercol_f po<br />
  65  ON p.othercol_f = po.othercol_f<br />
  66  WHERE p.othercol_f = pm.othercol_f;</li>
  67  </ul></code>' );
  68    define('REASON_TABLE_ALREADY_EXISTS','Cannot create table %s because it already exists');
  69    define('REASON_TABLE_DOESNT_EXIST','Cannot drop table %s because it does not exist.');
  70    define('REASON_TABLE_NOT_FOUND','Cannot execute because table %s does not exist.');
  71    define('REASON_CONFIG_KEY_ALREADY_EXISTS','Cannot insert configuration_key "%s" because it already exists');
  72    define('REASON_COLUMN_ALREADY_EXISTS','Cannot ADD column %s because it already exists.');
  73    define('REASON_COLUMN_DOESNT_EXIST_TO_DROP','Cannot DROP column %s because it does not exist.');
  74    define('REASON_COLUMN_DOESNT_EXIST_TO_CHANGE','Cannot CHANGE column %s because it does not exist.');
  75    define('REASON_PRODUCT_TYPE_LAYOUT_KEY_ALREADY_EXISTS','Cannot insert prod-type-layout configuration_key "%s" because it already exists');
  76    define('REASON_INDEX_DOESNT_EXIST_TO_DROP','Cannot drop index %s on table %s because it does not exist.');
  77    define('REASON_PRIMARY_KEY_DOESNT_EXIST_TO_DROP','Cannot drop primary key on table %s because it does not exist.');
  78    define('REASON_INDEX_ALREADY_EXISTS','Cannot add index %s to table %s because it already exists.');
  79    define('REASON_PRIMARY_KEY_ALREADY_EXISTS','Cannot add primary key to table %s because a primary key already exists.');
  80    define('REASON_NO_PRIVILEGES','User '.DB_SERVER_USERNAME.'@'.DB_SERVER.' does not have %s privileges to database '.DB_DATABASE.'.');
  81  
  82  ?>


Généré le : Mon Nov 26 16:45:43 2007 par Balluche grâce à PHPXref 0.7
  Clicky Web Analytics