Re: One SQL, two conns

From: Harag (haragREMOVETHESECAPITALS_at_softhome.net)
Date: 08/29/04


Date: Sun, 29 Aug 2004 10:46:16 +0100

On Sun, 29 Aug 2004 06:04:42 GMT, "Stuart Palmer"
<stuartglenpalmer@ntlworld.com> wrote:

>Hi There,
>I'm writing an ASP cart and hit a problem.
>
>I have 2 db's, one is products, one is cart contents.
>
>Cart contents holds the unique ID from products when you do your 'basket'.
>
>When I display the basket, I want to display the products name from the
>products DB based on the ID stated in the cart DB
>
>I have been informed I can do this with SQL some how, but that means I'd
>have to create two conn objects? or can it be done another way?
>
>Thx for the advise.
>
>Stu
>

2 DBs or 2 tables in 1 DB ?
what DB are you using access?

for SQL (as I've never used access) you would join the 2 tables
together to get the result. since I don't know your Table layouts
(Provide DDL) I'm just guessing.

SELECT p.ProdID, p.ProdName, b.Quantity, p.Price, (b.Quantity*p.Price)
as Total
        FROM basket b INNER JOIN
        Products p ON b.ProdID = p.ProdID
        WHERE b.MemberID = 23 -- user number of logged in person.

HTH.

Al.



Relevant Pages

  • Why a blank page??
    ... I have a problen getting some information to display on my internet ... to view the store's shopping cart the user ... the cart with his/her alloted cartId, ...
    (comp.lang.php)
  • Re: Going OO
    ... if I was building a cart from scratch I'd think .... ... So you could have a Shop object and a ShoppingCart object, ... Due to the stateless way web servers work, the ShoppingCart must be "refreshed" from the session and/or the database at every page buildup. ... {// code to display the contents. ...
    (comp.lang.php)
  • help on online-shopping cart..
    ... im working on a simple cart, whenever the user click on "add to cart" ... link i store the data to mysql. ... this is how i display the contents of the basket of the user... ...
    (comp.lang.php)
  • Re: One SQL, two conns
    ... tables within cart database. ... > I'm writing an ASP cart and hit a problem. ... > Cart contents holds the unique ID from products when you do your 'basket'. ... > When I display the basket, I want to display the products name from the ...
    (microsoft.public.inetserver.asp.general)
  • how to add click function to dynamically created Button in WebForm?
    ... the books on a table. ... I would like to add "add to cart" button. ... The Buttons display fine on the WebForm. ...
    (microsoft.public.dotnet.csharp.general)

Loading