Jump to content

db to array


poe

Recommended Posts


i have a db table that has linkid cat id and page number

 

linkid catid page

1 1 1

2 1 1

3 1 1

4 1 2

5 1 2

6 1 2

7 1 3

8 2 1

9 2 1

10 2 1

11 3 1

12 3 1

13 3 2

14 3 2

15 3 3

16 3 3

17 3 4

18 3 4

etc.....

 

 

i need to create this into an array that is in a structure like:

 

array

[catid] =>


 

grouped by catid and just the unique pages

 

so cat1 has pages 1,2,3

cat2 has pages 1

cat3 has pages 1,2,3,4

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.