Zen Cart Logo
Forums / General Questions / drop down menu & table joins

drop down menu & table joins

Locked

Views: 1,613

Results 1 to 2 of 2
This thread is locked. New replies are disabled.
7 Jul 2006, 7:44 PM
#1
mfp avatar

mfp

New Zenner

Join Date:
Mar 2006
Posts:
19
Plugin Contributions:
0

drop down menu & table joins

Hello,

I have a 3 part related question on incorporating a drop down lists from which people who want to be contacted can select their area of interest. Using version 1.3.0

One
I’m not sure how to create the drop down list properly:
I’ve assigned the drop down the name “PULL_DOWN_KW_EVENTS” and the code I am using looks like this and can be viewed here: http://thecompanykw.com/ec/index.php?main_page=contact_us

<label class="inputLabel" for="kwevents"><?php echo PULL_DOWN_KW_EVENTS; ?></label>
<select size="1" name="Event">
<option selected>Please select a Event of interest</option>
<option>Workshops</option>
< >Marathons</option>
<option>Parties / Night Life</option>
<option>Concerts</option>
<option>Premiers / Showcases</option>
<option>Panel Discussions</option>
<option>Spa / Resorts</option>
<option>Group Outings</option>
<option>Sporting Activities</option>
</select>

This code is in my tpl_contact_us_default.php file. Do I need to be using a php drop down list instead? If so, how can that be implemented?

Two
The other pages I attempted to modify are header_php.php which from what I understand puts the data in the database, which brings me to joining tables. This is where I need assistance in what code to write and where. This is what I’ve tried, but took it out cause it spoiled the view.

if($_SESSION['customer_id']) {
$sql = "SELECT customers_id, customers_firstname, customers_lastname, customers_password, customers_email_address, customers_default_address_id, kw_customer_id, kw_event, kw_product, kw_service, kw_comment
FROM " . TABLE_CUSTOMERS,TABLE_KW_CUSTOMER_PLUS . "
WHERE customers_id = :customersID, ";

How do you bind the variables, how should it look?

$sql = $db->bindVars($sql, ':customersID', $_SESSION['customer_id'], 'integer');

Three
I have created a table called: kw_customer_plus in the database that has a unique field with the keyname: idx_kw_customer_id_customers_id_zen related to customers_id in zen_customers table. Is that all I need here?

Thanks in advance,

9 Jul 2006, 9:08 AM
#2
mfp avatar

mfp

New Zenner

Join Date:
Mar 2006
Posts:
19
Plugin Contributions:
0

Re: drop down menu & table joins

I have not resoived this issue. If anyone can help it would be appreciated.

MFP:

Hello,

I have a 3 part related question on incorporating a drop down lists from which people who want to be contacted can select their area of interest. Using version 1.3.0

One
I’m not sure how to create the drop down list properly:
I’ve assigned the drop down the name “PULL_DOWN_KW_EVENTS” and the code I am using looks like this and can be viewed here: http://thecompanykw.com/ec/index.php?main_page=contact_us

<label class="inputLabel" for="kwevents"><?php echo PULL_DOWN_KW_EVENTS; ?></label>
<select size="1" name="Event">
<option selected>Please select a Event of interest</option>
<option>Workshops</option>
< >Marathons</option>
<option>Parties / Night Life</option>
<option>Concerts</option>
<option>Premiers / Showcases</option>
<option>Panel Discussions</option>
<option>Spa / Resorts</option>
<option>Group Outings</option>
<option>Sporting Activities</option>
</select>

This code is in my tpl_contact_us_default.php file. Do I need to be using a php drop down list instead? If so, how can that be implemented?

Two
The other pages I attempted to modify are header_php.php which from what I understand puts the data in the database, which brings me to joining tables. This is where I need assistance in what code to write and where. This is what I’ve tried, but took it out cause it spoiled the view.

if($_SESSION['customer_id']) {
$sql = "SELECT customers_id, customers_firstname, customers_lastname, customers_password, customers_email_address, customers_default_address_id, kw_customer_id, kw_event, kw_product, kw_service, kw_comment
FROM " . TABLE_CUSTOMERS,TABLE_KW_CUSTOMER_PLUS . "
WHERE customers_id = :customersID, ";

How do you bind the variables, how should it look?

$sql = $db->bindVars($sql, ':customersID', $_SESSION['customer_id'], 'integer');

Three
I have created a table called: kw_customer_plus in the database that has a unique field with the keyname: idx_kw_customer_id_customers_id_zen related to customers_id in zen_customers table. Is that all I need here?

Thanks in advance,