This is a big puzzle for me.
I have a line of code like this:
$Fields = mysql_fetch_assoc($Result);
I then call it like this:
<?php echo $Fields['BusinessName']; ?>
The strange thing is that there are no errors but no data is shown. But when I rename the variable $Fields as $Field, the data shows.
For local testing I used Ubuntu and the error was first noticed on the host (LAMP).
I checked to see if $Fields is a reserved word in PHP but I can't seem to find any hints on this.
Appreciate any inputs on this. Thanks!
Here's the code that WORKS:
$strQuery = "SELECT * FROM tblAds WHERE AdRef = '{$ThisAd}' LIMIT 1 ";
$Result = mysql_query($strQuery);
$Field = mysql_fetch_assoc($Result);
Now in the html body area, I insert the echo statement like mentioned earlier in the post and it works.
But the moment I change it to $Fields, there's no error, and no output. When I say no output, the field contents is shown as blank. But the page continues to load without the data.
Just for the ones curious, there is one error alert about a session variable already being declared but this is not relevant.
I hope this is clear.