Code: Select all
tags when posting code. Read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url][/color]
Basically, I have a problem I've been working on for a while that seems really simple, but I am not able to get it going. Basically I have a table in mysql with a set of tools, then comments on those tools. Ex:
Call Monitor
-> Comment about Call Monitor
-> Another Comment about Call monitor
Stats Tool
-> Comment about stats tool
-> Another Comment stats tool
Basically, I have 25 tools which are in their own table, which is joined to the comments table. I want to create a loop that counts the amount of tools (right now its 25, but it will change) and loops that amount of times, and displays the name of those tools, something like this:Code: Select all
$sql = "SELECT * FROM types ORDER BY tdesc";
$result = $dbi->ex($sql);
mysql_fetch_array($result);
$count = mysql_numrows($result);
// then loop based on the number of rows
// and loop for each comment for each tool :thumbsup:it sounds simple but doesnt seem to work well.
Here is what I have now (which does not work)
Code: Select all
echo "<table width="700" border="1" class="fbtable">";
echo "<br><strong>$ary[name]</strong><br>";
echo "<tr>
<td width="10%" class="fbtabletop">Type</td>
<td width="70%" class="fbtabletop">Comment</td>
<td width="10%" class="fbtabletop">Submitter</td>
<td width="10%" class="fbtabletop">Date</td>
</tr>";
// this is the part I want to loop
echo "<tr>
<td class="fbtablecell"><strong>$ary[tdesc]</strong></td>
<td class="fbtablecell"><strong>$ary[text]</strong></td>
<td class="fbtablecell"><strong>$ary[who]</strong></td>
<td class="fbtablecell"><strong>$ary[date]</strong></td>
</tr><br>\n";
} // end of while loop
} // end of view sectionAny ideas?
feyd | Please use
Code: Select all
tags when posting code. Read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url][/color]