I am trying to do a simple drill-down that queries a table, loops the data, but inside of each loop I would like to do another query using the rowid and the userid to see if a record exits. I don't think a join would work(?) because if the corresponding row doesn't exist in the other table, it wouldn't display the data from the first table, right? Any ideas . . .
Caleb
mysql_connect(localhost,$username,$password);
@mysql_select_db($database) or die( "Unable to select database");
$query="SELECT * FROM content";
$result=mysql_query($query);
$num=mysql_numrows($result);
mysql_close();
$i=0;
while ($i < $num) {
$contentdesc=mysql_result($result,$i,"contentdesc");
$contenttimereq=mysql_result($result,$i,"contenttimereq");
$contentfileloc=mysql_result($result,$i,"contentfileloc");
$contentid=mysql_result($result,$i,"contentid");
echo" <tr>
<td colspan='2' class='text' bgcolor='#EFEFEF'><strong>$contentdesc</strong></td>
</tr>
<tr><td width='210' class='text'>Time Req: $contenttimereq min.</td><td width='210' class='text'>Status: ";
THIS IS WHERE I WANT TO RUN ANOTHER QUERY USING THE OUTPUTTED $contentid variable as a where selector along with the session-stored userid
$i++;
print("</td></tr>");
}