homepage Welcome to WebmasterWorld Guest from
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Pubcon Platinum Sponsor 2014
Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
Forum Library, Charter, Moderators: coopster & jatar k

PHP Server Side Scripting Forum

Can I use Arrays here?

10+ Year Member

Msg#: 12608 posted 11:59 pm on Apr 22, 2006 (gmt 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?





WebmasterWorld Senior Member 10+ Year Member

Msg#: 12608 posted 12:03 pm on Apr 24, 2006 (gmt 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?

Global Options:
 top home search open messages active posts  

Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved