Results 1 to 8 of 8
  1. #1
    Join Date
    Aug 2009
    Posts
    13
    Plugin Contributions
    0

    Default optimizing database

    Whenever I've tried to optimize my database through the admin/store manager I get the error message:

    1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '-Cart' at line 1
    in:
    [SHOW TABLE STATUS FROM vfv_Zen-Cart]
    If you were entering information, press the BACK button in your browser and re-check the information you had entered to be sure you left no blank fields.

    What is it and how do I fix it so I can optimize my database?

  2. #2
    Join Date
    Jan 2004
    Posts
    66,373
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: optimizing database

    Since you've used a hyphen in your database name, you'll need to alter the code to add backquotes around it: http://www.zen-cart.com/forum/showthread.php?t=100191
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  3. #3
    Join Date
    Aug 2009
    Posts
    13
    Plugin Contributions
    0

    Default Re: optimizing database

    Hi,

    thank you for your help. I just got around to trying what you suggested and it didn't seem to help.

    the file I edited:

    \httpdocs\catalog\myadmin\store_manager.php

    Old code looked like this:
    case ('optimize_db'):
    // clean out unused space in database
    $sql = "SHOW TABLE STATUS FROM " . DB_DATABASE;
    $tables = $db->Execute($sql);

    New code looks like this:
    case ('optimize_db'):
    // clean out unused space in database
    $sql = "SHOW TABLE STATUS FROM `" . DB_DATABASE . "`";
    $tables = $db->Execute($sql);

    Does everything look OK to you? Any other suggestions?

    Thank you for your help in advance.

  4. #4
    Join Date
    Jan 2004
    Posts
    66,373
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: optimizing database

    That looks about right.
    If it's not working for you, you have 4 options:
    1. don't worry about optimizing at all ... for years it's never mattered to most shopowners ... unless you get hundreds of orders a day and remove and add thousands of new products every week, it's probably not even needed.
    2. use the "optimize database" option provided in your hosting company's control panel, if they have one
    3. use the Optimize option to optimize your tables using phpMyAdmin
    4. keep playing with the PHP code to make it work as you desire
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  5. #5
    Join Date
    Aug 2009
    Posts
    13
    Plugin Contributions
    0

    Default Re: optimizing database

    Thank you

  6. #6
    Join Date
    Jul 2009
    Location
    Melbourne, Australia
    Posts
    80
    Plugin Contributions
    0

    Default Re: optimizing database

    Quote Originally Posted by DrByte View Post
    Since you've used a hyphen in your database name, you'll need to alter the code to add backquotes around it: http://www.zen-cart.com/forum/showthread.php?t=100191
    The solution that link provides is this:

    The reason why you are getting this error is because you have a - in your database.

    To sort this problem you need to.

    Edit store_manager.php

    FIND:
    $sql = "SHOW TABLE STATUS FROM " . DB_DATABASE ;

    REPLACE:
    $sql = "SHOW TABLE STATUS FROM `" . DB_DATABASE . "`";

    But can some one tell me, what ARE back-quotes? Are they those double quotation marks? And what is that weird little symbol between the double quotation marks at the end of the last line?

  7. #7
    Join Date
    Jan 2004
    Posts
    66,373
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: optimizing database

    A back-quote is a reverse-direction quotation mark: `
    On some keyboards it's located to the left of the "1" key, usually on the same key as the ~ symbol.
    That's what that "weird little symbol", as you call it, is.
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  8. #8
    Join Date
    Jul 2009
    Location
    Melbourne, Australia
    Posts
    80
    Plugin Contributions
    0

    Default Re: optimizing database

    Thanks Dr Byte!

 

 

Similar Threads

  1. Optimizing database to avoid hitting memory limits?
    By laurelsstitchery in forum General Questions
    Replies: 5
    Last Post: 29 Dec 2012, 06:40 PM
  2. Optimizing the Store
    By ideasgirl in forum Templates, Stylesheets, Page Layout
    Replies: 12
    Last Post: 19 Sep 2007, 03:54 PM
  3. Optimizing Site
    By brikat in forum General Questions
    Replies: 10
    Last Post: 4 Jun 2007, 05:16 AM

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