thefollower Posted July 16, 2008 Share Posted July 16, 2008 i have a field which contains this exact string: <a href="cafe.php">Cafe <?=$CityName?></a> But on output on the php page all it shows it: Cafe For some reason it won't show the <?=$CityName?>. The variable is set as i do not get a undefined variable error. So is it something to do with mysql stopping php tags coming out with its string? This is the script, as you see i have put no special function to be prevent the <?=$ to be loading up so i do not know why it isn't loading it: <?php $SELECT = mysql_query("SELECT Link FROM citypages WHERE Area='$CityArea' AND (CityID='$CityID' OR CityID='0')") Or die(mysql_error()); While($row = mysql_Fetch_assoc($SELECT)){ ?> <?=$row['Link']?><br> <?php } ?> Quote Link to comment https://forums.phpfreaks.com/topic/115034-output-issues/ Share on other sites More sharing options...
MadTechie Posted July 16, 2008 Share Posted July 16, 2008 "undefined variable" means the variable hasn't been set it doesn't exist ie <?php echo $test; //<--undefined variable $test = "tester"; //Set variable echo $test; //<--working variable ?> the problem doesn't seam to be with the SQL, but with the page that has <a href="cafe.php">Cafe <?=$CityName?></a> personally i don't use short tags try <?php echo $row['Link']; ?> Quote Link to comment https://forums.phpfreaks.com/topic/115034-output-issues/#findComment-591554 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.