php - Displaying mysql returns in clean and professional tabular report -


This is my second question (to date) this week. My first success was a successful solution, so I thought it might be lucky too. I want to layout / design return returns to my query like this:

  Date1 | ID | Time | Updated by Status update | 1 | 04:06 | User1 | This is a comment. 2 | 05:05 | User2 | This is a comment again. 3 | 05:08 | User1 | This is another comment. 4 | 07:09 | User3 | And this is also a 2th date. ID | Time | Updated by Status update | 5 | 04:06 | User3 | This is a comment for Day 2. 6 | 05:05 | User3 | This is a comment for the day 2 date again. ID | Time | Updated by Status update | 7 | 04:06 | User1 | This is a comment. 8 | 05:05 | User2 | This is a comment again. 9 | 05:08 | User2 | This is another comment. 10 | 07:09 | User3 | And also   

here is my php code ...

  mysql declaration here {resonates "table" = '0' align = Center class = 'tablefont' & gt; tr class = 'colheadbg' & gt; & gt; & gt; date & lt; / th> & lt; th & gt; id & lt; / th & gt; & Lt; th & gt; Time & lt; / th> updated by & lt; th> & lt; / Th & gt; & lt; th & gt; Status Update & lt; / th & Gt; & lt; / tr & gt; "; While ($ info = mysql_fetch_array ($ data)) {$ id_num = $ id_num + 1; Anco "& lt; tr & gt; & lt; td & gt;" $ Info ['date']. "& Lt; / td> & lt; TD & gt; $ id_num & lt; / td & gt; & lt; td & gt; $ Info ['time'] "& lt; / td> & lt; td & gt; $ Info ['User'] "& Lt; / td> & lt; td & gt; $ Info ['Notification'] "& Lt; / td>"; Echo "& lt; / tr & gt;"; } Resonates "& lt; / table & gt;"; }? & Gt;   

So far, it offers a tabular form report that I really do not want. I've heard this "group", but I really need to get a good starter-idea.

Create a $ date variable in your function and then on every move Compare to current rows:

  var $ date = ""; While ($ info = mysql_fetch_array ($ data)) {$ id_num = $ id_num + 1; Echo "& lt; tr & gt;"; If ($ date == $ info ['date']) {echo "". $ Info ['date']. & Lt; / Td> & Lt; Td> $ Id_num & lt; / Td> & Lt; Td> "$ Info ['time']." & Lt; / Td> & Lt; Td> "$ Info ['user']." & Lt; / Td> & Lt; Td> "$ Info ['remarks']." & Lt; / TD & gt; ";} and {$ date = $ info ['date']; // set it for the new date / spell your line}" & lt; / Tr & gt; "echo;}   

updated from OP screenshot
  var $ date =" "while ($ info = mysql_fetch_array ( $ Data)) {$ id_num ++; echo "& lt; Tr & gt; "; if ($ date == $ info ['date']) {echo" & lt; Td> "./** Nothing ** /." & Lt; / Td> "; & lt; td> $ id_num & lt; / td> & lt; td & gt; {$ info ['time']}  & lt; ; Td> {$ info ['User']} & lt; / td> & lt; TD & gt; {$ information ['comment']} & lt; / td & gt; "; } And {$ date = $ info ['date']; // Set it for a new date "End Lit; TD> Date $   $ id_num  & lt; td> gt; ; {$ Info ['time']} & lt; / td> & lt; td & gt; {$ info ['user']} & lt; / td & gt; & lt; td & gt; { $ Info ['remarks']} & lt; / td & gt; "; } Resonates "& lt; / tr & gt;"; }   

What you are seeing in your screenshot, it seems that it can fix it.

Comments

Popular posts from this blog

excel vba - How to delete Solver(SOLVER.XLAM) code -

github - Teamcity & Git - PR merge builds - anyway to get HEAD commit hash? -

ios - Replace text in UITextView run slowly -