Results 1 to 6 of 6
  1. #1
    Join Date
    Nov 2005
    Location
    France
    Posts
    595
    Plugin Contributions
    8

    Default Define new db tables

    I'm making some improvements to the Dangling Carrot mod as it overwrites several core files at the moment. The problem i'm faced with is that i added a declare to the original database_tables file. I now want to move this to includes/extra_datafiles, which is where i think it is supposed to be. I put it into this folder with a name of free_gift_database_tables but it does not seem to get read when the cart is loaded as i get an error stating Table 'zentest.table_carrot' doesn't exist.

    Am i putting this in the right place, or does it need to be declared somewhere before it will function.

    Thanks.

    Steve

  2. #2
    Join Date
    Jan 2004
    Posts
    66,419
    Blog Entries
    7
    Plugin Contributions
    277

    Default Re: Define new db tables

    Try adding the .php extension to the file?
    /includes/extra_datafiles/free_gift_database_tables.php
    .

    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
    Nov 2005
    Location
    France
    Posts
    595
    Plugin Contributions
    8

    Default Re: Define new db tables

    Dr Byte,

    I'm not a total novice...it is saved with the .php extension

    I've not found a solution to this, so if anyone has any more ideas, please share them.

    And, can anyone explain why db tables are delared in includes, rather than admin/includes?

    Regards
    Steve

  4. #4
    Join Date
    Jun 2008
    Location
    Washington, DC
    Posts
    785
    Plugin Contributions
    7

    Default Re: Define new db tables

    Quote Originally Posted by strelitzia View Post
    Dr Byte,

    And, can anyone explain why db tables are delared in includes, rather than admin/includes?

    Regards
    Steve
    /admin/includes/extra_datafiles/free_gift_database_tables.php
    PHP Code:
    // example
    define('FREE_GIFT'DB_PREFIX 'free_gifts'); 
    I am not familiar with this mod but if it only needs admin thats where the table define file goes.
    • 446F63746F722057686F •

  5. #5
    Join Date
    Nov 2003
    Posts
    1,987
    Plugin Contributions
    15

    Default Re: Define new db tables

    Looking at the error message you posted it looks like the database table is defined correctly, but the table does not exist.

    The definition tells the php script what the table name is, it does not create the table.

  6. #6
    Join Date
    Jan 2004
    Posts
    66,419
    Blog Entries
    7
    Plugin Contributions
    277

    Default Re: Define new db tables

    Quote Originally Posted by strelitzia View Post
    Dr Byte,

    I'm not a total novice...it is saved with the .php extension

    I've not found a solution to this, so if anyone has any more ideas, please share them.

    And, can anyone explain why db tables are delared in includes, rather than admin/includes?

    Regards
    Steve
    Your original message didn't make any mention of "admin".

    If your admin area needs access to the table, you'll have to add the define for the table name in the admin side as well, as skipwater pointed out.
    .

    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.

 

 

Similar Threads

  1. New SQL Tables in mods
    By torvista in forum All Other Contributions/Addons
    Replies: 1
    Last Post: 31 Oct 2015, 06:01 PM
  2. New Install, Old Tables
    By fishchairs in forum Installing on a Linux/Unix Server
    Replies: 8
    Last Post: 2 Jan 2010, 03:03 PM
  3. Define Pages - How to define brand new page
    By hutch32804 in forum Customization from the Admin
    Replies: 4
    Last Post: 31 Oct 2009, 01:39 PM
  4. Adding new tables to the database
    By ChrisTenn in forum General Questions
    Replies: 2
    Last Post: 1 Feb 2007, 05:59 PM
  5. MZMT: Can't Define 2 GeoZones tables for 1 zone
    By qisahn in forum Addon Shipping Modules
    Replies: 2
    Last Post: 25 Jan 2007, 02:58 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