Since when did:
//echo "[$sql][$result][$rows][$e]<BR>";
cause an error? The code following this comment gets spwewed out as source in the browser!
Bear in mind I use php daily, I've never seen this before! I'm porting an ancient php app from an old Win2k box to a new Windoze 2003 server - apache 2.2, mysql 5.1.32, php 5.2.9, and the app is bombing all over the place cos there's commented out code everywhere.
Any switches to stop it being so sensitive to comments?
I know //
followed by ?>
then code will break as ?>
terminates the php, but BR tags ? Surely not.
More details: The code chunk is
if ($condition){
// do stuff
} else {
$sql="select * from person where percode='$person'";
$result=mysql_db_query($db,$sql,$conn);
@$rows=mysql_num_rows($result);
$e=mysql_errno()." ".mysql_error();
//echo "[$sql][$result][$rows][$e]<br>";
$perfname=mysql_result($result,0,"perfname");
$persname=mysql_result($result,0,"persname");
$peraddr1=mysql_result($result,0,"peraddr1");
}
?>
The code up to the comment runs fine. The code after the comment up to the ?> is vomited out into the browser. After that, the HTML display is fine. Remove comment (or even just the < and > around the BR makes code work just fine.