MySQL Database Php

// Create database and table code for MySQL below
//CREATE DATABASE [dbname]
//CREATE TABLE `menu` (
// `id` int(3) NOT NULL default '0',
// `menu_item` varchar(32) NOT NULL default '',
// PRIMARY KEY (`id`)
//) TYPE=MyISAM;
// Stylesheet code below (inline or external works fine)
?>





// ADO Connection description
$db = "DRIVER={MySQL ODBC 3.51 Driver};SERVER=127.0.0.1;DATABASE=dbname;UID=user;PWD=password; OPTION=35";
// Create connection object
$conn = new COM("ADODB.Connection") or die("Cannot start ADO");
// Open the database
$conn->Open($db);
// Execute the query
$rs = $conn->Execute("SELECT id, menu_item FROM menu ORDER by id;");
// Get section / menu name
$section = $_REQUEST['section'];
// Remove URL encoded chars
$decoded = rawurldecode($section);
// Remove white spaces from menu item for JavaScript to handle
preg_replace('/.\s/', '', $decoded);
// Build the memu
echo "";
while (!$rs->EOF) {
echo "
\n";
} else {
echo " class='out'> " . $rs->Fields[menu_item]->Value . " \n";
}
$rs->MoveNext();
}
echo "\n" .
"
if ($section != $rs->Fields[menu_item]->Value) {
echo " class='out'
onMouseOver=\"this.className='over'\"
onMouseOut=\"this.className='out'\"
onMouseDown=\"this.className='down'\"
onClick=\"location.href='" . $PHP_SELF . "?sctn=" . $rs->Fields[menu_item]->Value . "&id=" . $rs->Fields[id]->Value . "';\"> " .
$rs->Fields[menu_item]->Value . "
";
?>