seran128 Posted November 14, 2006 Share Posted November 14, 2006 I have a table that holds values for a menu I then have a function that I call that build that menuI want to add a | between the values so the menu looks likeitem1 | item2 | item3 | item4 ........[code]function getmenu(){ global $connection; $sql=mysql_query("SELECT * from menu order by sort_order") or die(mysql_error()); while($row=mysql_fetch_array($sql)) { $getmenu .= stripslashes($row['title']); } return $getmenu;}?>[/code] Link to comment https://forums.phpfreaks.com/topic/27274-dynamic-menu/ Share on other sites More sharing options...
seran128 Posted November 14, 2006 Author Share Posted November 14, 2006 I figured it out[code]function getmenu(){ global $connection; $sql=mysql_query("SELECT * from menu order by sort_order") or die(mysql_error()); $getmenu .= "<table width='100%' border='0'><tr><td><span class='copy'> "; while($row=mysql_fetch_array($sql)) { $getmenu .= "<a href=javascript:menulink(" . $row['ID'] . ")>" . stripslashes($row['title']) . " | "; } $getmenu .= "</span></td></table>"; return $getmenu;}[/code] Link to comment https://forums.phpfreaks.com/topic/27274-dynamic-menu/#findComment-124733 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.