<?php
function GetFeedbackList($username){
global $conn;
$q = "SELECT feedback.date, treatments.problem FROM feedback, treatments WHERE feedback.username='$username' AND treatments.username='$username' ORDER BY feedback.date";
$result = mysql_query($q,$conn);
while($row = mysql_fetch_assoc($result))
{
?><tr>
<td align="center" bgcolor="#CCFFCC">
<br><font face="Arial" color="Blue" size="2"><?php echo date('j F Y', strtotime($row['feedback.date'])); ?></font><br>
</td>
<td align="center" bgcolor="#CCFFCC">
<br><font face="Arial" color="Blue" size="2"><?php echo $row['treatments.problem']; ?></font><br>
</td>
<td align="center" bgcolor="#CCFFCC">
<br><input type="radio" name="feedback"><br>
</td>
</tr>
<?php
}
}
That is the function I am trying to use. The two tables are feedback and treatments, and i wish to get the date from the feedback table and the problem from the treatments table.
When i use the function, i dont get any errors, but it displays two rows of information when there is only one feedback for that user. Also, the data it displays is incorrect, the Date fields for both displays 1st January 1970, and the Problem field is empty.
If anyone has any idea how to solve this it would definitely be appreciated.
Thanks a lot
James