Designing my system with different department

Ask about general coding issues or problems here.

Moderators: egami, macek, gesf

Post Reply
acellec
php-forum Active User
php-forum Active User
Posts: 26
Joined: Thu May 17, 2012 5:44 pm

Fri May 25, 2012 10:26 pm

Can you help me in my system design?

I have more than 20 users with different departments.

What i did is this 20 users will access one interface or php form. For example main.php, this main.php will determine each user and their departments and save it into session.

Then each form in my system will get the username and department in session and
access mysql table depending on the username and department.

Example if username's department is finance department then access tblfinance, if user's department is planning then table to access
is tblplanning.


My question is if all users will access for example addform.php simultaneously, then add records, is it possible that i will get an error
because they are accessing the same addform.php but differrent tables to retrieve?

is my system design good? HELP ME PLEASE
acellec
php-forum Active User
php-forum Active User
Posts: 26
Joined: Thu May 17, 2012 5:44 pm

Sat May 26, 2012 6:24 am

hello please advice. this is a critical for my my job pleae
throwcode
php-forum Active User
php-forum Active User
Posts: 34
Joined: Mon Sep 05, 2011 7:35 am

Sat May 26, 2012 3:50 pm

Hi acellec,

I don't see how your example would be a problem.

I believe that in a single threaded application like PHP your major concern for contention should be in calls to functions that have arguments and significant logic to process or static methods with arguments and lots of logic to process. You can generally avoid this using Objects which can be instantiated, unique to each user.

Web pages should never be an issue unless you have multiple sessions from the same browser. Each browser receives a unique page and each submit is processed separately using the user's id.

TC.
acellec
php-forum Active User
php-forum Active User
Posts: 26
Joined: Thu May 17, 2012 5:44 pm

Sat May 26, 2012 11:32 pm

tHANK YOU SO MuCH :)
acellec
php-forum Active User
php-forum Active User
Posts: 26
Joined: Thu May 17, 2012 5:44 pm

Sun May 27, 2012 6:23 pm

throwcode wrote:Hi acellec,

I don't see how your example would be a problem.

I believe that in a single threaded application like PHP your major concern for contention should be in calls to functions that have arguments and significant logic to process or static methods with arguments and lots of logic to process. You can generally avoid this using Objects which can be instantiated, unique to each user.

Web pages should never be an issue unless you have multiple sessions from the same browser. Each browser receives a unique page and each submit is processed separately using the user's id.

TC.
One thing more, I designed my code like this...

for example addform.php

if user's department is finance
then to retrieve the table i code it like this "tblname".add
so that it will retrieve financeadd table.

if user's department is cash
then to retrieve the table i code it like this "tblname".add
so that it will retrieve cashadd table.


will i get a problem on this?
Post Reply