php - Display multiple rows as one in MySQL -


I want some advice

I have created a web app where a user can assign multiple forms The recipients simultaneously insert multiple rows (one line per recipient) in a work form_assignments such that the table is like so:

  foreach (as the $ line $ Recipients) {$ query = "insert in form_assignments (SENDER_ID, recipient_id, form_id, DUE_DATE, priority_id, comment, completion) values ​​('{ $ {SENDER_ID} ','. $ Line ['id']. ", '{$ Assign_form_id}', '2014 -04-30 00:00:00', '{$ priority_ID}', '{$ comment}' In the above example,  $ recipient  is an array containing  $ row ['id'], '{$ completed}');   

Therefore, an assignment can generate these 100 rows (for 100 recipients), for example, and each recipient of "complete" Can edit your personal line in the form it is now Far better.

The problem is, if I want to generate a list of assignments for that user, then I should see only one row for the multi-user assignment (not one line

I like to be able to show a table to the user:

You have been assigned: Form 1: 50 Users Reason: April 25, 2014 User Full: 10 See User List < / Em>

and assign each group to one The account will appear:

User 1 has given you the following form: Due to Form 1: April 25, 2014, click to mark as complete < p> I do not know about this, how to know about it, if someone can point me in the right direction, then I appreciate it.

If I understand you correctly, you want to present the assigning person For the result of each assignment / date grouped by a list of assignments, assignment and date, you also want to show how many users have already completed the assignment rights.

So you want to select from the assignment and your result will be sender_id , form_id and DUE_DATE first:

  select SENDER_ID, form_id, GroupedAssignments group groupedAssignments.sender_id, groupedAssignments.form_id, groupedAssignments.due_date from task as   

Now you want < Code> JOIN How many students have already ended this assignment to find out the given task. This is the reason why I added the nickname 'Group Assetment' to join a join since your

  as the finishedAssignments function JOIN (groupedAssignments.sender_id = finishedAssignments.sender_id and groupedAssignments.form_id = finishedAssignments .form_id and groupedAssignments.due_date = finishedAssignments.due_date and finishedAssignments.completed = TRUE)   

You can add a calculation to:

  Select group group as swagames.adder_id, groupedsignments.form_id, group Assessment. Add assignments as tasks completed in the form of groups that were grouped in the form of data (COUNT), finished as Assassinated (Sponsored Assignment), (Grouped Permissions.ender_id = Expirations.Company_ID and Grouped Assignments.form_id = finishedAssignments. Form_id and grouped assignment.data_data = expired asset.data and endassment.plotted = TRUE) Assignments finished by group. Sheanda_ID, Finnish Assetments.form_id, FinishesSig Nments.due_date   

Obviously I did not do this test and it will not work for you, but it should take you in the right direction. Read more on

Comments

Popular posts from this blog

Java - Error: no suitable method found for add(int, java.lang.String) -

java - JPA TypedQuery: Parameter value element did not match expected type -

c++ - static template member variable has internal linkage but is not defined -