Happy Christmas Eve everyone,
I've been looking around for the past few hours and my searches return useful information, but not with the same effect in mind as what I am trying to achieve.
Essentially I am trying to create some form that is pulled from a MySQL database using two queries that I pull into their result sets and then close the connection and then display information in the first query on the top, and then the related information of the second query listed underneath it in an unordered list (or table element).
For example:
00100 | ABC | Call | Joe | Open
00101 | DEF | Call | Joe | Closed
What I have now is...
This works, except it produces an unordered list for every note beneath it's related record, or an empty unordered list if the related record has no notes.
Can someone help me out with this problem? The current method works, but it's not right.
I've been looking around for the past few hours and my searches return useful information, but not with the same effect in mind as what I am trying to achieve.
Essentially I am trying to create some form that is pulled from a MySQL database using two queries that I pull into their result sets and then close the connection and then display information in the first query on the top, and then the related information of the second query listed underneath it in an unordered list (or table element).
For example:
00100 | ABC | Call | Joe | Open
- NOTE 1
- NOTE 2
00101 | DEF | Call | Joe | Closed
What I have now is...
Code:
while($row = good_assoc($result)) { echo "{$row['Service_id']}" . " | " . "{$row['ReferenceNumber']}" . " | " . "{$row['TypeName']}" . " | " . "{$row['CurTech']}" . " | " . "{$row['CurStatus']}<br />\n"; while($row2 = good_assoc($result2)) { if(in_array($row['Service_id'],$row2)) { echo "<ul>\n"; if($row['Service_id']==$row2['Service_id']) { echo "<li>{$row2['Service_id']} | {$row2['FirstName']} | {$row2['CreatedDate']} | {$row2['Note']}</li>\n"; } echo "</ul>\n"; } } mysql_data_seek($result2,0); }
Can someone help me out with this problem? The current method works, but it's not right.
Comment