How can I return a statement to the browser if there is no result
I have tried the following but it doesn't work
//Execute SQL & get result
$sql_result = mysql_query($sql, $connection) or die ("Sorry the query could not be executed");
if (!$sql_result) {
echo "<p> Couldn't add comments";
} else {
echo "
<head>
<title>Add a product</title>
<link rel=stylesheet href=../home_files/home_styles.css type=text/css>
</head>
<body bgcolor=#666666 topmargin=0>
<div align=center>
<table cellpadding=2 cellspacing=0 bgcolor=#cccccc width=80% height=100%>
<tr>
<td height=27 width=787 valign=top align=center><img src=../img/addcomments.gif width=137 height=17></td>
</tr>
<tr>
<td height=19></td>
</tr>
<tr>
<td height=23 valign=top align=center class=dbgeneral>Thank you, your
comments have now been added</td>
</tr>
<tr>
<td height=26></td>
</tr>
</table>
</div>
</body>
";
}
?>