开发者

Ouput from Database for specific user

If I have a cart table for example with a list of cartIDs and Customer ID which is linked to a car开发者_开发技巧t details table which contains the products for each cart etc.

If I want to output the cart for the user currently logged in would doing something like work?

SELECT FROM tblCart [CartID] AND tblCartDetail [title], [price],[image] 
WHEN CustomerID=CurrentlyLoggedInID

I know the SQL isn't correct but would that idea work? Or would it just output the whole cart for when the two values match?


I believe what you're looking for is called a SQL join.


Use a parameter, so CustomerID = @CurrentlyLoggedInID. Then set the parameter equal to the membership.getuser() string.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜