Chris S
Retired
- Messages
- 2,055
- Reaction score
- 1
- Points
- 38
Can you guess what this does. it was hard to write so i hope its hard to guess
btw: Alejandro is not allowed to answer
PHP:
<?php
$array1 = array();
$query1 = mysql_query("SELECT * FROM `point_option`") or die(mysql_error());
while ($row1 = mysql_fetch_array($query1)){
echo "<td>".$row1['name']."</td>";
$array1[] = $row1['name'];
}
?>
</tr>
<?php
$grade = $_GET['grade'];
$query = mysql_query("SELECT * FROM `points` WHERE `grade` = '$grade'") or die(mysql_error());
while ($row = mysql_fetch_array($query)){
?>
<tr>
<td><?php echo $row['name']; ?></td>
<td><?php echo $row['grade']; ?></td>
<?php
foreach($array1 as $fName => $fInfo){
echo '<td>'.$row[$fInfo].'</td>';
}
?>
</tr>
<?php
}
?>
btw: Alejandro is not allowed to answer
Last edited: