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] Quote Link to comment 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] Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.