Hi there, first off I'm relatively new to php so please forgive me if this seems a simple request!
I have an existing database and menu system which works great, but I'm trying to modify it so that I have a checkbox that I can tick to determine if I want the result shown on the menu or not.
In mysql I've created a simple table where if the box is checked then "1" is shown.
The problem I have is asking php to echo the result "if" the box is checked, this is the code I have thus far (I know it's real messy!)
$query = mysql_query("SELECT * FROM employees WHERE flag = 's' ORDER BY time")
or die(mysql_error());
while($row = mysql_fetch_array( $query )) {
{
}
echo "<p class=\"text\">";
echo "<img src=\"http://www.****.png\" width=\"20\" height=\"16\" align=\"absmiddle\"/>";
echo " ";
echo $row['time'];
echo " ";
echo $row['match'];
echo " ";
if($row['match']) echo "<a href=\"http://www.****/{$row['id']}.html\">Watch <img src=\"http://www.****/play.png\" align=\"absmiddle\"/></a>"; else echo "" ;
echo "</p>";
}
?>
Now this is the existing code and as I said, it works, but when I try to insert and if arguement then an else I just get a syntax error
$query = mysql_query("SELECT * FROM employees WHERE flag = 's' ORDER BY time")
or die(mysql_error());
while($row = mysql_fetch_array( $query )) {
{
}
if ($row['av'] == "1")
echo "<p class=\"text\">";
echo "<img src=\"http://www.****.png\" width=\"20\" height=\"16\" align=\"absmiddle\"/>";
echo " ";
echo $row['time'];
echo " ";
echo $row['match'];
echo " ";
if($row['match']) echo "<a href=\"http://www.****/{$row['id']}.html\">Watch <img src=\"http://www.****/play.png\" align=\"absmiddle\"/></a>"; else echo "" ;
echo "</p>";
else echo "";
}
?>
any chance anyone can tell me where I'm going wrong?
Many thanks in advance!