Hi I’m working menu page for a restaurant and in the process of fetching data from MySQL database to display on page.
The problem I’m having is that there is 3 Main Categories, being Traditional Favourites, Starters, and Mains
ONLY Within Traditional Favourites and are 3 SubCategories, being Dosa, Steamed Rice Cakes & Breads
Traditional Favourites as Heading
Dosa, Steamed Rice Cakes & Breads as Sub Headings
under each Sub Heading should be dish titles and price
Below is what I’ve created so far:
[code]
$connect = mysqli_connect($hostname, $username, $password);
mysqli_select_db($connect, $database_name);
if ($connect) {
$queryCatTitle = “SELECT lookupTblMenuItem_Category.lookupTblMenuItem_Category_CategoryTitle FROM lookupTblMenuItem_Category WHERE lookupTblMenuItem_Category.lookupTblMenuItem_Category_CategoryTitle = ‘Traditional Favourites'”;
$runSql = mysqli_query($connect, $queryCatTitle);
if($runSql) {
if (mysqli_num_rows($runSql) > 0) {
while ($resultCatTitle = mysqli_fetch_assoc($runSql)) {
print_r($resultCatTitle);
}
}
}
} else {
die(“Connection could not be established: ” . mysqli_connect_error());
}
?>
being a newbie to PHP MySQL I’m not even sure is this is correct but having tested it it displays Array ( [lookupTblMenuItem_Category_CategoryTitle] => Traditional Favourites ) on the page so I know I’m half way there.
Could someone please possible provide me with a pointer, ideas, or even a solution?
Many thanks
__(Added `[code]…[/code]