Jump to content

PHP Design Advice Please


leachus2002

Recommended Posts

Hi All,

 

I currently have a ticketqueue that show's all tickets assigned to a group of people, but split into personal queues, but the way that I wrote it, means that it needs manually updating if a specific person leaves/joins the department. For example, to get the queue details, I use the following query:

 

$username1 = mssql_query("select id,subject,body,priority from queue where assignedto = username1"
$username2 = mssql_query("select id,subject,body,priority from queue where assignedto = username2"

 

I have repeated this code for all of the users in our team. Which seams a waste, as I have all the information on our team stored in a DB called "sysadminusers". Is there an array I could use that would look at all the usernames in the table, and then repeat the query for me?

 

I would also need this array to display the results on the page, currently I use the following:

 

while($username1_tickets = mssql_fetch_assoc($username1)){
echo $username1_tickets['id'],$username1_tickets['subject']$username1_tickets['body'],$username1_tickets['priority'];}
while($username2_tickets = mssql_fetch_assoc($username2)){
echo $username2_tickets['id'],$username2_tickets['subject']$username2_tickets['body'],$username2_tickets['priority'];}

 

I am just looking for some design advice and code examples that would help me tidy up my code for this page, it seams a lot of code for quite a simple page.

 

Thanks

Matt

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.