Right now, I take the date of each cell, and pass it as a query to mysql and put the response in that cell output.
That was the easy way to do it.
But now i realize I could have selected dates between, and then used php to search the returned array for the date and then find the cell which matches that date and put the value in that cell.
The second way seems much more complicated, but I am concerned about long-term efficiency. Can anybody tell me which way is more efficient?
Here's an example of the code I have now
Expand|Select|Wrap|Line Numbers
- echo"</tr><tr class=\"notes\"><td>$first_name $last_name Notes</td>";
- $un=0;
- $newDate3 = date('y/m/d', mktime(0,0,0, $month, $day+$un, $year));
- while($un<7){
- $queryUserNote = "SELECT notes.note FROM notes WHERE date = '$newDate3' AND uid = '$uid'";
- $resultUserNote = mysql_query($queryUserNote)or die(mysql_error('could not get personal notes'));
- $userNoteArray=mysql_fetch_array($resultUserNote);
- $userNote = $userNoteArray['note'];
- echo "<td class=\"notes\">$userNote</td>";
- $un++;
- }
Pete