Thread: Mysql?

Results 1 to 5 of 5
  1. #1
    Join Date
    Jan 2018
    Posts
    165
    Plugin Contributions
    4

    Default Mysql?

    I am updating a plugin and question about updating MySQL to MYISAM and utf8_general_ci

    here is the code:

    CREATE TABLE `zipcodezone` (
    `zipcode_id` INT( 11 ) NOT NULL AUTO_INCREMENT PRIMARY KEY,
    `zipcode_start` char(3) NOT NULL default '0',
    `zipcode_end` char(3) NOT NULL default '0',
    `zipcodezone` int(1) NOT NULL default '0');

    INSERT INTO `zipcodezone`
    (`zipcode_id` ,`zipcode_start` ,`zipcode_end` ,`zipcodezone`)

  2. #2
    Join Date
    Jul 2012
    Posts
    16,719
    Plugin Contributions
    17

    Default Re: Mysql?

    What is the question?

    What happens when the above is attempted? What is expected?

    If the database has been converted such that all aspects of it are consistent, then new tables should also be created with the same consistency.

    If there is qestion about the format of the table sql, then suggest also looking at install sql available at: zc_install/sql/install/mysql_zencart.sql
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  3. #3
    Join Date
    Jan 2007
    Location
    Australia
    Posts
    6,167
    Plugin Contributions
    7

    Default Re: Mysql?

    Quote Originally Posted by tmccaff View Post
    I am updating a plugin and question about updating MySQL to MYISAM and utf8_general_ci

    here is the code:

    CREATE TABLE `zipcodezone` (
    `zipcode_id` INT( 11 ) NOT NULL AUTO_INCREMENT PRIMARY KEY,
    `zipcode_start` char(3) NOT NULL default '0',
    `zipcode_end` char(3) NOT NULL default '0',
    `zipcodezone` int(1) NOT NULL default '0');

    INSERT INTO `zipcodezone`
    (`zipcode_id` ,`zipcode_start` ,`zipcode_end` ,`zipcodezone`)

    The CREATE TABLE will work, but without a little extra code it will create the default database type (InnoDB?) rather than the MyISAM that you want. Having said that, you can easily change the database type after it has been created (preferbaly before inserting any data).

    The INSERT INTO command *won't* work because you've not specified any values to insert. The code should read like:
    INSERT INTO `zipcodezone` (`zipcode_id` ,`zipcode_start` ,`zipcode_end` ,`zipcodezone`) VALUES (1,2,3,4) ;


    If this isn't the answer you are seeking, then perhaps you could be a little more specific in regards to your question/problem.

    Cheers
    RodG

  4. #4
    Join Date
    Jan 2018
    Posts
    165
    Plugin Contributions
    4

    Default Re: Mysql?

    Ok this is what I got; is this correct?

    PHP Code:
    CREATE TABLE zipcodezone (
      
    zipcode_id int(11NOT NULL auto_increment,
      
    zipcode_start varchar(3NOT NULL default '0',
      
    zipcode_end varchar(3NOT NULL default '0',
      
    zipcodezone int(1NOT NULL default '0',
      
    PRIMARY KEY  (zipcode_id)
    ENGINE=MyISAM DEFAULT COLLATE utf8_general_ci;

    INSERT INTO zipcodezone (zipcode_idzipcode_startzipcode_endzipcodezone)
    VALUES (1'004''005'8),
    (
    2'010''089'8),
    (
    3'100''199'8),
    (
    4'200''299'8),
    (
    5'300''306'8),
    (
    6'341''349'8),
    (
    7'307''307'7),
    (
    8'308''324'8),
    (
    9'325''325'7),
    (
    10'326''339'8),
    (
    11'341''349'8),
    (
    12'350''362'7),
    (
    13'363''363'8),
    (
    14'364''367'7),
    (
    15'368''368'8),
    (
    16'369''375'7),
    (
    17'376''379'7),
    (
    18'380''397'7),
    (
    19'398''399'8),
    (
    20'400''402'7),
    (
    21'403''418'8),
    (
    22'420''424'7),
    (
    23'425''426'8),
    (
    24'427''427'7),
    (
    25'430''459'8),
    (
    26'460''469'7),
    (
    27'470''470'8),
    (
    28'471''479'7),
    (
    29'480''489'8),
    (
    30'490''491'7),
    (
    31'492''492'8),
    (
    32'493''495'7),
    (
    33'496''497'8),
    (
    34'498''499'7),
    (
    35'500''503'6),
    (
    36'504''504'7),
    (
    37'505''505'6),
    (
    38'506''507'7),
    (
    39'508''516'6),
    (
    40'520''559'7),
    (
    41'560''562'6),
    (
    42'563''564'7),
    (
    43'565''565'6),
    (
    44'566''567'7),
    (
    45'570''576'6),
    (
    46'577''577'5),
    (
    47'580''588'6),
    (
    48'590''591'5),
    (
    49'592''593'6),
    (
    50'594''594'5),
    (
    51'595''595'6),
    (
    52'596''599'5),
    (
    53'600''634'7),
    (
    54'635''635'6),
    (
    55'636''639'7),
    (
    56'640''649'6),
    (
    57'650''652'7),
    (
    58'653''653'6),
    (
    59'654''655'7),
    (
    60'656''676'6),
    (
    61'677''679'5),
    (
    62'680''689'6),
    (
    63'690''690'5),
    (
    64'691''692'6),
    (
    65'693''693'5),
    (
    66'700''709'7),
    (
    67'710''711'6),
    (
    68'712''716'7),
    (
    69'717''719'6),
    (
    70'720''725'7),
    (
    71'726''738'6),
    (
    72'739''739'5),
    (
    73'740''768'6),
    (
    74'769''769'5),
    (
    75'770''789'6),
    (
    76'790''794'5),
    (
    77'795''796'6),
    (
    78'797''812'5),
    (
    79'813''815'4),
    (
    80'816''832'5),
    (
    81'833''833'4),
    (
    82'834''838'5),
    (
    83'840''847'4),
    (
    84'850''851'3),
    (
    85'852''852'4),
    (
    86'853''854'3),
    (
    87'855''860'4),
    (
    88'863''864'3),
    (
    89'865''874'4),
    (
    90'875''877'5),
    (
    91'878''879'4),
    (
    92'880''885'5),
    (
    93'889''892'3),
    (
    94'893''898'4),
    (
    95'900''933'2),
    (
    96'934''934'3),
    (
    97'935''935'2),
    (
    98'936''939'3),
    (
    99'940''961'4),
    (
    100'970''975'5),
    (
    101'976''976'4),
    (
    102'977''986'5),
    (
    103'988''994'5); 

  5. #5
    Join Date
    Jan 2007
    Location
    Australia
    Posts
    6,167
    Plugin Contributions
    7

    Default Re: Mysql?

    Quote Originally Posted by tmccaff View Post
    Ok this is what I got; is this correct?
    It creates the specified database type and the table gets populated with the data provided, with no errors.
    Whether the data is *correct* for purpose or not is something I can't say.

    Cheers
    RodG

 

 

Similar Threads

  1. Replies: 4
    Last Post: 13 Dec 2014, 04:48 AM
  2. v150 Backup MYSQL Plugin 2005: Unknown MySQL server host 'localhost:3306' (1)
    By nuganics in forum All Other Contributions/Addons
    Replies: 7
    Last Post: 10 Mar 2012, 08:09 AM
  3. Problems with manually upgrading MySQL 4 to MySQL 5
    By 2004g35 in forum Installing on a Linux/Unix Server
    Replies: 0
    Last Post: 29 Oct 2009, 02:15 AM
  4. Dreaded mYSQL 1064 error when importing MySQL 4 database into MySQL5
    By dml311071 in forum Installing on a Linux/Unix Server
    Replies: 4
    Last Post: 10 Jun 2008, 05:38 AM
  5. find/replace (sub)strings in zen's mysql-DB (mysql syntax question)
    By mypashop in forum Upgrading from 1.3.x to 1.3.9
    Replies: 2
    Last Post: 19 Oct 2007, 02:21 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR