Hi all!
First off, sorry if this question is a completely dumb one but i'm really new to PHP.
I'll paste the code to start with...
function getReasons ($id)
{
global $link;
$rst = mysql_query('SELECT r.name as reason FROM entries_feedback_comments as f LEFT JOIN reasons as r ON r.id = f.reason_id WHERE f.feedback_id ='. $id, $link);
while ($row = mysql_fetch_assoc($rst))
{
echo $row['reason'];
}
}
later on in the code.... inside a table structure i do this...
echo '<tr class="' . ($y?'even':'odd') . '">';
echo '<td colspan="10" class="freetext">'.getReasons($row['id']).'</td>';
echo '</tr>';
echo '<tr class="' . ($y?'even':'odd') . '">';
echo '<td colspan="10" class="freetext">'.$row["freetype"].'</td>';
echo '</tr>';
(I have left put the "freetype" bit of code in to show you that it works with this row but not with the function).
Basically, what I see is the result of the function outside of the table itself rather than in the table row.
Is there a reason for this? Does a function have to be put in specific places in the code?
Thank you for your help.
Sam