[simple] menu loading from mysql db
Posted: Tue Jun 21, 2011 2:37 am
i know this is very easy and probably not the most secure someone might find some use
<?php function vertical_menu() { mysql_connect('localhost','root',''); mysql_select_db("menu"); $result = mysql_query("SELECT name,link FROM menu"); while ($row =mysql_fetch_array($result)){ $name=$row['name']; $url=$row['link']; echo "<a href ='$url'>$name</a> <br /> "; } } function hori_menu() { mysql_connect('localhost','root',''); mysql_select_db("menu"); $result = mysql_query("SELECT name,link FROM menu"); while ($row =mysql_fetch_array($result)){ $name=$row['name']; $url =$row['link']; echo "<a href ='$url'>$name</a> || "; } } ?>when i get the cast off my hand ill work on the basic functions of a game and release code just because it will help me learn more