Here's the function it uses to print the name which is in the item file:

                function showRelationship($Item, $relationship, $description)
        {
                /*
                ** Related items
                */
                $CrossSellCount=0;
                if(isset($Item['Relationship'][$relationship]))
                {
                        $CrossSellCount =
count($Item['Relationship'][$relationship]);
                }

                if($CrossSellCount > 0)
                {
                        print("<BR>\n");
                        print("$description\n");
                        print("<UL>\n");

                        for($n=0; $n<$CrossSellCount; $n++)
                        {
                                $RelatedItem =
GetItemInfo($Item['Relationship'][$relationship][$n]);

                                print("<LI><A HREF=\"".ScreenURL('item',
FALSE, array('item'=>$RelatedItem['ID']))."\">");

                                print($RelatedItem['Name']);

                                print("</A>");
                        }

                        print("</UL>\n");
                }


        }
Now combined with what I have for the query (see previous posts) what would
I have to add to this to make it print the price?

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]On Behalf Of Christie Walker
Sent: Monday, April 09, 2001 8:21 AM
To: FreeTrade
Subject: Re: [FreeTrade] Relationshps and Prices


If the query works in mysql then it sounds like a problem with your
php displaying the info I think.  Are you sure you didn't miss
something small like a variable capitalized wrong or something?

Another reason a query would work in mysql and not on a webpage
is permissions, but since all the freetrade tables get built at once
and used as the same user I don't think that is the case here....

On 8 Apr 2001, at 17:07, Joker wrote:

> Here's what I have so far..this is in the item_functions file
>
>                         $Query = "SELECT ii.Related_Item, r.Name,
> s.Item,s.ListPrice ";
>                         $Query .= "FROM item_item ii, relationship r,
>                         sku s
> ";
>                         $Query .= "WHERE ii.Item = $Item_ID ";
>                         $Query .= "AND ii.Relationship = r.ID and
>                         s.Item =
> ii.Related_Item ";
>                         $DatabaseResult =
>                         mysql_query($Query,$DatabaseLink);
>                         while($DatabaseRow
> =mysql_fetch_object($DatabaseResult)
> )
>                         {
>
> $Item['Relationship'][($DatabaseRow->Name)][] =
> $DatabaseRow->Related_Item;
>                         }
>
> if I run the query from mysql it seems to work fine but for some
> reason when I try it on the page itself I cant get it to show the
> price..if I can get the ListPrice to work I can get the SalePrice to
> work.
>
> > From: "Tom Jakobsen" <[EMAIL PROTECTED]>
> > Reply-To: "FreeTrade" <[EMAIL PROTECTED]>
> > Date: Sun, 8 Apr 2001 22:51:58 +0200
> > To: "FreeTrade" <[EMAIL PROTECTED]>
> > Subject: Re: [FreeTrade] Relationshps and Prices
> >
> > SELECT ListPrice, SalePrice FROM sku WHERE Item = $RelatedItemID
> >
> >
> > if ($SalePrice)
> > {
> > $itemprice=$SalePrice;
> > }
> > else
> > {
> > $itemprice=$Listprice;
> > }
>
>
>
> ------------------------------------------------------------
> To subscribe:    [EMAIL PROTECTED]
> To unsubscribe:  [EMAIL PROTECTED]
> Site:            http://www.working-dogs.com/freetrade/
> Problems?:       [EMAIL PROTECTED]




------------------------------------------------------------
To subscribe:    [EMAIL PROTECTED]
To unsubscribe:  [EMAIL PROTECTED]
Site:            http://www.working-dogs.com/freetrade/
Problems?:       [EMAIL PROTECTED]



------------------------------------------------------------
To subscribe:    [EMAIL PROTECTED]
To unsubscribe:  [EMAIL PROTECTED]
Site:            http://www.working-dogs.com/freetrade/
Problems?:       [EMAIL PROTECTED]

Reply via email to