I have an sql query which grabs 'page names' in a database.
I have created a loop to output the pagename in an anchor tag like so:
echo "<a href=\"\">" .$row['PageName']. "</a>";
Only trouble is I need to use
$row['PageName']
in the
<a href=\"\">
It doesn't work when I do this:
echo "<a href=\"$row['PageName']\">" .$row['PageName']. "</a>";
Tried doing this by placing the sql output in a variable:
while ($row = mysql_fetch_array($result))
$pagename = $row['PageName'] . ".html";
{
echo "<a href=\"$pagename\">" .$row['PageName']. "</a>";
}
Can someone tell me how to place the page name into the link, to output all the names as links in the page?
Cheers!