Code: Select all
if(isset($_POST['grade']) && isset($_POST['subject']) && isset($_POST['type']) ){
$type = array();
foreach($_POST['type'] as $ftype=>$i) {
$type[$ftype] = $i;
// $_POST['type'] = unserialize($row['type']);
$data0 = mysql_query("SELECT * FROM uploadedfiles WHERE grade='".$_POST['grade']."' AND typeOfContent= '".$i."' AND (subject1='".$_POST['subject']."' OR subject2='".$_POST['subject']."' OR subject3='".$_POST['subject']."') ");
while($result0 = mysql_num_rows($data0)){
echo '<html><body><table><tr>';
echo '<th>id</th>';
echo '<th>File</th>';
echo '<th>Name</th>';
echo '<th>type</th>';
echo '<th>size</th>';
echo '<th>grade</th>';
echo '<th>age range</th>';
echo '<th>country</th>';
echo '<th>type of content</th>';
echo '<th>Duration</th>';
echo '<th>IPR type</th>';
echo '<th>Subject1</th>';
echo '<th>subject2</th>';
echo '<th>Subject3</th>';
echo '<th>animation Title</th>';
echo '<th>asset Type</th>';
echo '<th>scheme Of Work</th>';
echo '<th>Keywords</th>';
echo '<th>learning goals</th>';
echo '<th>summary</th>';
echo '<th>audio</th>';
echo '</tr>';
while ($row0 = mysql_fetch_row($data0)) {
echo '<tr>';
$count0 = count($row0);
$y = 0;
while ($y < $count0) {
$c_row0 = current($row0);
echo '<td>' . $c_row0. '</td>';
next($row0); $y = $y + 1;
}
echo '</tr>';
}
echo '</table></body></html>';
mysql_free_result($data0);
echo '<br/>';
}
}
if(empty($_POST['grade']) && empty($_POST['subject']) && !empty($_POST['type'])){
echo "Also select a subject and a grade.";
} elseif ( mysql_num_rows($data0) != 1 )
{
echo "No results found.<br>";
}exit;
}
i am really new to php.Thank you