cancel
Showing results for 
Search instead for 
Did you mean: 

MySQL Help needed

N/A

MySQL Help needed

Where can I find the answer to this puzzel?

Users can log-in to a page that only shows certain links depending on who that user is.

now I have got the login bit working but I can't think of a way to get a array inside MySQL which is what it would need, the way I see it...

a field with the link, job name and allowed users whould be needed:

Link Job Users
http:// 1234 user1, user2, user 5 user100
http:// 1235 user3, user4
etc etc etc

Any help would be great


Will
9 REPLIES
N/A

RE: MySQL Help needed

that table didn't really work... heres another attempt...
Link--------------Job----------------Users
http://----------1234----------user1, user2, user 5 user100
http://----------1235----------user3, user4
etc--------------etc--------------etc

Any help would be great

Will

N/A

RE: MySQL Help needed

Good Afternoon,

We don't support MySQL coding. However I will look into this later on when it gets quieter and email you with what I've found.

My email address is dscotland@plus.net

Kind Regards

Duncan
--
| Duncan Scotland          Unmetered & ADSL solutions
| Senior Technical Consultant   for Home & Business
| PlusNet Technologies Ltd. @ http://www.plus.net
+ ------- My Referrals - It pays to recommend PlusNet ---------
N/A

RE: MySQL Help needed

Cheers Duncan,

if you could send anything you may find to william.blackburn@parkingroup.co.uk I would most appreciate it Smiley
N/A

RE: MySQL Help needed

I'll make sure Dunk has a look at this when he's next in.

Thanks
Chris
--
| Chris Rugen ............................... Unmetered & ADSL solutions
| Senior Technical Consultant ................... for Home & Business
| PlusNet Technologies Ltd .......................... http://www.plus.net
+ ----- My Referrals - It pays to recommend PlusNet ----------
tim_fenton
Grafter
Posts: 49
Registered: 10-08-2007

RE: MySQL Help needed

One suggestion I have is that it would be better to assign "roles" to the users so that you only have to specify which roles can see which links. That way you won't have a huge maintenance overhead specifying each user against a link...
N/A

RE: MySQL Help needed

> One suggestion I have is that it would be better to assign "roles" to the users so that you only have to specify which roles can see which links. That way you won't have a huge maintenance overhead specifying each user against a link...

For this type of thing I find a link table works well. If you have pages A, B & C and users a, b and c you can fill the link table with all the matches you want.
e.g.
Link.id, Page_id, User_id
1 1 1
2 1 2
3 1 3
4 2 2
5 3 3

This will give user a(id=1) access to page A(id=1), user b access to pages A & B and user c access to pages A & C.

Your select will then need to be something along the lines of select url from Page, User, Link where Page.id = Link.Page_id and User.id = Link.User_id

Hope this makes sense / works.

Paul Brooks
N/A

RE: MySQL Help needed

Oops - missed a bit in the where clause...

> Your select will then need to be something along the lines of select url from Page, User, Link where Page.id = Link.Page_id and User.id = Link.User_id and user.id = xxx

Paul Brooks

N/A

RE: MySQL Help needed

Oops - missed a bit in the where clause...

> Your select will then need to be something along the lines of select url from Page, User, Link where Page.id = Link.Page_id and User.id = Link.User_id and user.id = xxx

Paul Brooks

N/A

RE: MySQL Help needed

Thanks I think I understand where your comming from I will give it a go today if I find time, but I will keep you all posted thanks a lot guys!!!

Cheers

Will