I have a very basic WHILE loop that pulls in selcted data from my MySQL database, courtesy of the MySQL statement. I want to be able to insert an IF statement into it, but I continually get parse errors. Does anybody know a way I can achieve this?
The code I have is:
while ( $row = mysql_fetch_array($cursor) )
{
echo("<TR><TD>" . $row["Restaurant"] . "</TD><TD><a href=" . $row["HperlinkAdd"] . ">$test</a><TD>" . $row["Address"] . "</TD><TD>" . $row["District"]."</TD><TD>" . $row["PC"]."</TD><TD>" . $row["Phone"]."</TD></TR>");
//<TD><a href=" . $row["HperlinkAdd"] . ">click here</a><br>\n</TD>
}
And I want to insert:
If ($row["HperlinkAdd"] == "")
{
$test = "";
}
Else
}
$test = "Click here";
}
Thanks😕