HighDots Forums  

Handling "related items"

Macromedia Dreamweaver Macromedia Dreamweaver Discussions (macromedia.dreamweaver)


Discuss Handling "related items" in the Macromedia Dreamweaver forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
finch8243 webforumsuser@macromedia.com
 
Posts: n/a

Default Handling "related items" - 07-13-2003 , 02:46 PM






Hello -- I want to build a product page that has a section for "related items". Right now my product database has a column for "related items" in which I have put the product ID number for a related item.

I can pull up the product page recordset based on one product ID number easy enough. I'm having trouble pulling up a second recordset for the related item based on that second ID number which is found in a column of the first. Any idea how I could do this? Here's my current script (copied out of Dreamweaver . . . I am a newbie), but it keeps giving me an error. Thanks.

<?php require_once('Connections/Duke.php'); ?>
<?php require_once('Connections/Duke.php'); ?>
<?php
$colname_rsProductPage = "1";
if (isset($HTTP_GET_VARS['PROD_NUM'])) {
$colname_rsProductPage = (get_magic_quotes_gpc()) ? $HTTP_GET_VARS['PROD_NUM'] : addslashes($HTTP_GET_VARS['PROD_NUM']);
}
mysql_select_db($database_Duke, $Duke);
$query_rsProductPage = sprintf("SELECT PROD_NUM, MANU_NAME, PROD_FAMILY, PROD_NAME, UNIQUE_NAME, CATEGORY_1, CATEGORY_2, PRICE, DESCRIPTION, DESIGNER, DIMENSIONS, MATERIAL, IMAGE_600, IMAGE_250, IMAGE_050, COLOR_PALETTE, RELATED_1, RELATED_2, RELATED_3, RELATED_4, LOCATION_1, LOCATION_2, LOCATION_3, LOCATION_4 FROM TSIMproducts WHERE PROD_NUM = %s", $colname_rsProductPage);
$rsProductPage = mysql_query($query_rsProductPage, $Duke) or die(mysql_error());
$row_rsProductPage = mysql_fetch_assoc($rsProductPage);
$totalRows_rsProductPage = mysql_num_rows($rsProductPage);

mysql_select_db($database_Duke, $Duke);
$query_rsVariants = "SELECT UNIQUE_NAME FROM TSIMproducts WHERE PROD_NAME =".$row_rsProductPage['PROD_NAME'];
$rsVariants = mysql_query($query_rsVariants, $Duke) or die(mysql_error());
$row_rsVariants = mysql_fetch_assoc($rsVariants);
$totalRows_rsVariants = mysql_num_rows($rsVariants);



Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.