wat ik probeer te maken is dat hij als de result bij "gezien" nee is de tabel row rood maakt en als hij bij gezien "ja" is geen kleur.
Nu krijg ik het alleen voor elkaar dat ALLES rood word of niks zit er al uren mee te stoeien maar krijg het niet voor elkaar
zie hier de code.
<?
$result = mysql_query("SELECT * FROM serie")
or die(mysql_error());
// display data in table
echo "<p><b>View All</b> | <a href='view.php?page=1'>View Paginated</a></p>";
<form id="form" name="form" method="POST" action="verzend.php" >
Zoeken: <input type="text" name="term" />
<input type="submit" name="submit" value="Zoek" />
</form>
echo "<table frame = 'border' WIDTH=100%>";
echo "<tr><td><h3>naam</td><td><h3>gezien</td><td><h3>uitgebracht</td><td><h3>commentaar</td><td><h3>episode</td><td><h3>foto</td><td><h3>Edit</td><td><h3>Delete</td></tr>";
$kleur = mysql_query("SELECT * FROM serie WHERE gezien ='nee'");
if (isset($kleur)){
// loop through results of database query, displaying them in the table
while($row = mysql_fetch_assoc( $result )) {
// echo out the contents of each row into a table
echo "<tr bgcolor='#FF0000'><td width=20%>".$row["naam"]."</td>";
echo "<td width=7%>".$row["gezien"]."</td>";
echo "<td width=10%>".$row["uitgebracht"]."</td>";
echo "<td width=42%>".$row["commentaar"]."</td>";
echo "<td width=4%>".$row["episode"]."</td>";
echo "<td width=10%><img src='".$row["foto"]."' width = '70' height= '120'/></td>";
echo "<td width=3%><a href=edit.php?id=".$row["id"].">edit</a></td>";
echo "<td width=4%><a href=delete.php?id=".$row["id"].">delete</a></td></tr>";
}
}
else {
// loop through results of database query, displaying them in the table
while($row = mysql_fetch_array( $result )) {
// echo out the contents of each row into a table
echo "<tr><td width=20%>".$row["naam"]."</td>";
echo "<td width=7%>".$row["gezien"]."</td>";
echo "<td width=10%>".$row["uitgebracht"]."</td>";
echo "<td width=42%>".$row["commentaar"]."</td>";
echo "<td width=4%>".$row["episode"]."</td>";
echo "<td width=10%><img src='".$row["foto"]."' width = '70' height= '120'/></td>";
echo "<td width=3%><a href=edit.php?id=".$row["id"].">edit</a></td>";
echo "<td width=4%><a href=delete.php?id=".$row["id"].">delete</a></td></tr>";
}
}
// close table>
echo "</table>";
<p><a href="nieuw.php">Voeg nieuwe Film toe</a></p>
</body>
</html>
?>
1.883 views