Welcome to WebmasterWorld Guest from 184.72.177.182

Forum Moderators: coopster & jatar k

Message Too Old, No Replies

Can I use Arrays here?

     
11:59 pm on Apr 22, 2006 (gmt 0)

Preferred Member

10+ Year Member

joined:Mar 4, 2004
posts:553
votes: 0


I am trying to make it easy for me to update my database so I would like to know if I can use arrays.

Basically I will have 12 columns to update, each column a different item, each item a different level. if any of these levels are higher than that of the person updating then I do not want it passed.

So eg

if Jim is level 5 and has 3 items at level 3 and 2 at 6 he can only equip 3 items.

anyone know?

thanks

Turk

12:03 pm on Apr 24, 2006 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:Jan 7, 2003
posts:1230
votes: 0


hi dkin,

you can use arrays for a lot of stuff and i guess you can use it "even" for your problem but i do not understand it fully.

you can implement the security within the php code and verify the input and the userlevel. so if you define a level for each column and compare that columnlevel to the userlevel then you should be fine to go. using an array here might help you to store and access the level for each column in an easy way. i.e. [tt]$columnlevel[0] = 3;[/tt] could set the level for column 0. with a foreach [php.net]you can then walk through all columns and compare it to the userlevel and eventually apply the update-value to your query if it's ok. finally a query is created with all the columns which are allowed only.

you thought about something like that?