ShibSta Posted May 7, 2006 Share Posted May 7, 2006 Sup, I am trying to figure out how to make a nav menu that pulls Categories, SubCategories, and Category ID's from my database. (MySQL) Then make a navigation tree with the data.I'll tell ya before I go any further, this is part of a script I bought. I know it's very sloppy and some of it is pretty retarded... However, I'd have to recode the entire thing to fix most of it.Anyway, currently I have this script.[code]<?php $self = $_SERVER['PHP_SELF']; $get22 = "SELECT cId, cName, gamesnumber FROM categories WHERE cVisible = 1 AND mcid = '1' ORDER BY $cat_sort ASC"; $result22 = @mysql_query($get22); while (list($id, $name, $gamesnumber) = @mysql_fetch_row($result22)) { echo "<a href=./test.php?lid=$id class=catename>$name<br>"; } $gameid5 = $_GET['lid']; if (!isset($gameid5)) { $gameid5 = "10"; } $get22 = "SELECT cId, cName, gamesnumber FROM categories WHERE cVisible = 1 AND mcid = '0' AND pcid ='$gameid5' ORDER BY $cat_sort ASC"; $result22 = @mysql_query($get22); while (list($id, $name, $gamesnumber) = @mysql_fetch_row($result22)) { echo "<a href=./test.php?action=category&id=$id&page=0&order2=game_name&sby=ASC class=catesub>- $name <i>($gamesnumber)</i><br>"; }?>[/code]Which displays something like this: [quote]CartoonsGamesMovies- Cartoons (0)[/quote][quote]CartoonsGamesMovies- Action / Adventure (0)- Sports (0)- Other (0)[/quote][quote]CartoonsGamesMovies- Commercials (0)- Misc (0)- Pranks (0)- Sports (0)[/quote]As you see it keeps displaying them at the bottom of the page, plus it has to reload the page each time.I am wanting a JS menu so that it won't reload the page each time, and a tree so it's easier to understand.However, I know nothing about combining PHP/JS.Could someone assist me in a situation like this please?Thanks,--ShibSta(PS: Sorry if this is the wrong forum, it sorta fit under 3 different ones.) Quote Link to comment Share on other sites More sharing options...
ShibSta Posted May 8, 2006 Author Share Posted May 8, 2006 ^^Bump Quote Link to comment Share on other sites More sharing options...
haydndup Posted May 8, 2006 Share Posted May 8, 2006 If you are wanting to update content without refreshing the page, you are going to need to have a look at XMLHTTPRequest. [a href=\"http://www.ajaxfreaks.com/tutorials.php\" target=\"_blank\"]Ajax Freaks[/a] has some nice tutorials etc. Not much good at JS i'm afraid, so i can't help you there. Good Luck. 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.