losing variables between php brackets

Posted on 16th Feb 2014 by admin

Hi

have got this code:
Code: $id=mysql_result($result,0,"itemid");
$title=mysql_result($result,0,"title");
$thumbnail=mysql_result($result,0,"data_txt");
$publish_up=mysql_result($result,0,"publish_up");
$hits=mysql_result($result,0,"hits");
echo $title;
?>


<h2>
<a href="#">
<?php $title; ?>
</a>
</h2>

This is a simplified version, but the second use of $title doesn't work at all, just returns blank, whereas the first does? Is there some rule about variables being lost across <?php ?> tags or something?

Other forums