Hey ,
back again with a prob. freshexams has a request feature, where users can search requests, and fill request based on if they find anything. But its very annoying to not have a table on the main page listing the requested exams, make finding requests ackward. I know how to make the table with php, but not sure how to call/query the info into the table.
the main table is requests, and the rows are
request_id sub_id sub_sub_id school class description is_filled uploader_id upload_date
request id is its upload id, starting at 1 from the first request.
subid is its respective main category(math, science, etc.)
subsubid is its subcategory underneath a main subject
school, class, description obv
is filled either 0/1
upload id and upload date obv
i just want a table like my search spits out, with the request id, school, class in the table descending. Today i realized there were about 10 requests, but i didnt know until i checked the db b/c the way it is now you only know if people requested an exam if you search for that specific one. Please help
This is the code I have to show a users uploaded exams in their account, only difference is diff table/rows
CODE
<?
$q="select * from `topics` where `uploader_id`='".$_SESSION['login_id']."'";
$r=mysql_query($q);
?>
<table width="500" border="1" align="center" cellpadding="0" cellspacing="0" bordercolor="#000033">
<tr align="center" valign="middle">
<td width="180" height="30" bgcolor="#CDE4FE"><strong><font face="Georgia,Times New Roman,serif">Subject</font></strong></td>
<td width="160" height="30" bgcolor="#CDE4FE"><strong><font face="Georgia,Times New Roman,serif">File
Name</font></strong></td>
<td width="160" height="30" bgcolor="#CDE4FE"><strong><font face="Georgia,Times New Roman,serif">Uploaded
Time</font></strong></td>
</tr>
<?
while($row=@mysql_fetch_array($r,MYSQL_BOTH))
{
$sub_id=$row[1];
$q2="select * from `subjects` where `id`=".$sub_id;
$r2=mysql_query($q2);
$row2=@mysql_fetch_array($r2);
$sub_name=$row2[1];
$subject=explode("_",$row2[1]);
?>
<tr align="center" valign="middle">
<td width="150" height="30"> <font color="#000033" size="2" face="Georgia,Times New Roman,serif">
<?=$subject[0]." >> ".$subject[1];?>
</font></td>
<td width="150" height="30"> <font color="#000033" size="2" face="Georgia,Times New Roman,serif">
<?=$row[3];?>
</font></td>
<td width="150" height="30"> <font color="#000033" size="2" face="Georgia,Times New Roman,serif">
<?=$row[8];?>
</font></td>
</tr>
<?
}
?>
</table>
<tr align="left" valign="middle">
<td> </td>
</tr>
Just unsure on how to modify this to show request id, school, class, description in the table...any help would be much appreciated.
This post has been edited by King8654: 16 Jul, 2008 - 11:55 AM