Welcome Guest, Not a member yet? Register   Sign In
Looping through mysql queries?
#1

[eluser]Guest[/eluser]
Hi guys,

I'm letting users of my site store their own page of items - a bit like google personal homepage.

I've stored their choices as a "TEXT" in a database this:

Code:
TBL_USERS:

UserName    PersonalPage
BOB        1,4,6,3,2
MAT        5,11,4,33
AMY        6,3,1,8,4


TBL_ITEMS:

itemID        itemName
1        Item1
2        Item2
3        Item3
4        Item4
etc...

So when "BOB" goes to his personal page, he would the details of each item he has selected.


To load the item's details on their personal pages, all i can think of is looping through each item in the array of "PersonalPage" IDs. But that could mean 20 queries on one page.

Could someone give me an idea of the right way to do this.

Many thanks!


Messages In This Thread
Looping through mysql queries? - by El Forum - 02-14-2010, 06:03 AM
Looping through mysql queries? - by El Forum - 02-14-2010, 07:38 AM
Looping through mysql queries? - by El Forum - 02-14-2010, 08:00 AM
Looping through mysql queries? - by El Forum - 02-14-2010, 08:26 AM
Looping through mysql queries? - by El Forum - 02-14-2010, 01:56 PM
Looping through mysql queries? - by El Forum - 02-15-2010, 12:35 PM



Theme © iAndrew 2016 - Forum software by © MyBB