I am trying to display a PHP variable within a <p> tag but I either keep getting errors or the name of the variable is shown but not it's content.
Here is the code:
echo '<div class="item" style="background-color:'.$row[colour].';width:'.$row[width].'px;"><a href="'.$row[link_url].'" title="'.$row[name].'"><p>$row[name]</p></a></div>';
Where I have written:
<p>$row[name]</p>
will not show up in the browser correctly and instead will just show the name of the variable. If I surround the variable with '' I get an error regaurding syntax.
I have also tried to echo the variable:
<p><?php echo $row[name] ?></p>
But on the website nothing is displayed at all and when I look in the FireFox inspector I see this:
The code has automatically been commented out?