Zen Cart Logo
Forums / Templates, Stylesheets, Page Layout / Accessing the database

Accessing the database

Locked

Views: 2,004

Results 1 to 3 of 3
This thread is locked. New replies are disabled.
24 May 2006, 8:48 PM
#1
ruby avatar

ruby

New Zenner

Join Date:
May 2006
Posts:
12
Plugin Contributions:
0

Accessing the database

Hi! I'm just getting my feet wet in this cool Zen Cart, and I'm wondering where I could find the script for accessing the database? I'm trying to customize my products page and I want to pull some data directly from the products table.

I could just write out my own script to connect to the database, but I figured that there's probably one written already, why not use it?

I'm having a lot of trouble finding my way around all the file includes and templates. It's a rather complicated entanglement of files!

24 May 2006, 10:54 PM
#2
bunyip avatar

bunyip

Totally Zenned

Join Date:
Sep 2004
Location:
Western Massachusetts
Posts:
2,361
Plugin Contributions:
1

Re: Accessing the database

There's already a query extracting data from both the products and products_descriptions table for that page - why not just add the fields you want to that query rather than create an extra query?

The query in question is constructed at line 45 in includes/modules/pages/product_info/main_template_vars.php and executed at line 62

24 May 2006, 11:03 PM
#3
ruby avatar

ruby

New Zenner

Join Date:
May 2006
Posts:
12
Plugin Contributions:
0

Re: Accessing the database

Yep, that's exactly what I want to do, and exactly what I needed to know. Thank you, bunyip! I appreciate your help:smile: