New Zenner
- Join Date:
- Jan 2007
- Posts:
- 2
- Plugin Contributions:
- 0
Adding new tables to the database
Hi all
I have added a table to the zen cart database called 'zen_products_kits'. The table has a products_id field as I need to link each entry to a particular product in the 'zen_products' table.
I have been trying to edit includes\modules\pages\product_info\main_template_vars.php to pull in data from this new table. However I dont understand how to edit the query as the current query looks like the below. However the table in my database is called 'zen_products' yet the code uses 'TABLE_PRODUCTS' but pulls in the info form 'zen_products' Could some one please explain how this works?
How would I write a query that also gets data from my new table called 'zen_products_kits'?
Many Thanks
Chris
$sql = "select count(*) as total
from " . TABLE_PRODUCTS . " p, " .
TABLE_PRODUCTS_DESCRIPTION . " pd
where p.products_status = '1'
and p.products_id = '" . (int)$_GET['products_id'] . "'
and pd.products_id = p.products_id
and pd.language_id = '" . (int)$_SESSION['languages_id'] . "'";