My goal is to have this output:
<div> - <a href="index.php">Index</a> - <a href="about.php">About</a> - <a href="etc.php">Etc</a> -</div>Here's my table:
name priority url english main 1 index Home about 2 about About more 3 etc EtcHere's my code:
//displays the links at the top of the page
function pagemenu($language){
$query = mysql_query("SELECT * FROM lang_text_pagenames ORDER BY priority") or die(mysql_error());
echo("<div> -");
while($menuitem = mysql_fetch_array($query)) {
echo(" <a href=\"".$root_dir.$menuitem['url'].".php\">".$menuitem[$language]."</a> -");}
echo("</div>");
}$root_dir is just './'; $language is e.g. 'English'. And here's what I get:<div> - <a href="index.php"></a> - <a href="about.php"></a> - <a href="etc.php"></a> -</div>What am I doing wrong?


Sign In
Create Account

Back to top









