|
|
|
1-0 = main1
1-1 = sub1
1-2 = sub2
2-0 = main2
2-1 = sub1
2-2 = sub2
.........
//<-----------menu.inc--------->
<?
require("config.inc");
$sql = "SELECT * FROM menu ORDER BY main, sub";
$result = @mysql_query($sql,$connection) or die("Couldn't execute query.");
while ($row = mysql_fetch_array($result)) {
$id = $row['id'];
$main = $row['main'];
$sub = $row['sub'];
$url = $row['url'];
$text = $row['text'];
if ($sub == "0") { $html = "<a href=\"$url_base$url\">$text</a><br>";
}
else { $html = "<em><a href=\"$url_base$url\">$text</a></em><br>";
}
$menu_block .= "$html";
}
echo "$menu_block";
?>
//<----------- end menu.inc--------->
//<-------Table SQL------->
CREATE TABLE menu (
id int(11) NOT NULL auto_increment,
text text NOT NULL,
main int(4) NOT NULL,
sub int(4) NOT NULL,
url varchar(50) NOT NULL,
PRIMARY KEY (id)
);
//<-------End SQL-------> |
|
| Message of the Day - Random Message (Needs MySQL!) Categories : Databases, HTML and PHP, PHP, MySQL | | | Alternating background color for HTML table rows Categories : PHP, Databases, MySQL, HTML and PHP | | | A very simple way to build and do a hierarchical html categories browser without javascript , just using html php and mySql
Categories : HTML and PHP, Databases, Algorithms, PHP, MySQL | | | Automatically printing the contents of an sql table in MySQL. Categories : MySQL, PHP, HTML and PHP, Databases | | | Pull Down Surfing - Surf on Change Categories : Java Script, MySQL, HTML and PHP, PHP, Databases | | | Dynamically generated pop-ups (Select items) Categories : PHP, HTML and PHP, MySQL, Databases | | | Creating thumbnails from MySQL Blobs online Categories : PHP, MySQL, Graphics, HTML and PHP, Databases | | | Record Set Paging with PHP (RSP) Categories : PHP, MySQL, Navigation, Databases, HTML and PHP | | | Functions for loading images into a MySQL database and displaying them. Categories : Graphics, HTML and PHP, MySQL, PHP, Databases | | | dynamic table columns Categories : PHP, HTML and PHP, Arrays, Databases, MySQL | | | Editing the virtusertable and sendmail.cw via PHP3.0 and Mysql Categories : MySQL, HTML and PHP, PHP, Databases | | | This function will populate the options in a drop down HTML select list
in a form from a database query.
Categories : MySQL, General SQL, PHP, HTML and PHP, Databases | | | How can i Preload a 'SELECT MULTIPLE'? Categories : HTML and PHP, PHP, MySQL, Databases | | | Paginating the mySQL data Categories : PHP, Algorithms, Databases, MySQL, HTML and PHP | | | PHP and MySQL scripting for Muyltiple CheckBoxes Categories : HTML and PHP, MySQL, Databases, PHP | |
|
|
|