Results 1 to 2 of 2
  1. #1
    Join Date
    Oct 2008
    Posts
    22
    Plugin Contributions
    0

    Default Access another database from a custom page?

    I need to access a separate MySQL database from inside a custom page in Zen Cart.

    I foolishly just added the code to access the database I wanted into the page, only to discover that this overrides Zen Carts connection to it's own database... ZC looks for tables like 'layout_boxes' in my database where it's obviously not going to find them.

    Closing the connection to my database once I'm finished with it doesn't help.

    This is all going in a tpl_mycustompage_default.php file in the includes/templates/mytemplate/templates directory.

    Do I need to reconnect to the Zen Cart DB after I've finished doing my thing? Any ideas?

  2. #2
    Join Date
    Oct 2008
    Posts
    22
    Plugin Contributions
    0

    Default Re: Access another database from a custom page?

    OK, I gave up and just added my table to the Zen Cart database...

    So now I'm using:

    Code:
    $result = $db->Execute("SELECT whatever FROM my_table");
    So what would be the equivalent of a mysql_fetch_row($result) using Zen Cart methods?

 

 

Similar Threads

  1. v152 How can copy some products from database to another database ?
    By dmagic in forum General Questions
    Replies: 5
    Last Post: 2 Jul 2018, 02:54 PM
  2. Replies: 13
    Last Post: 19 Sep 2012, 10:35 AM
  3. what's the best way to access another database?
    By delia in forum Contribution-Writing Guidelines
    Replies: 1
    Last Post: 3 May 2010, 02:16 PM
  4. import from access database
    By thornhillguy in forum General Questions
    Replies: 2
    Last Post: 15 Dec 2009, 12:00 PM
  5. access database from ez pages
    By chufty bill in forum Templates, Stylesheets, Page Layout
    Replies: 3
    Last Post: 15 Sep 2006, 04:33 PM

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