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
https://forums.phpfreaks.com/topic/225829-php-design-advice-please/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.