Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
php/msql menu problem
Old 07-12-2008, 09:19 AM php/msql menu problem
Novice Talker

Posts: 11
Name: Johan
Trades: 0
I have a great menu but i´t doesn´t work as i want it to..

I´ve got a index.php that includes menu.php

Se my homepage: http://jbnx.org/medialt/

menu.php -->

KOD:
PHP Code:
<?php 
include ("config.php"); 
$connection=mysql_connect($dbserver,$dbuser,$dbpass) or die ("Die Verbindung zum MySQL-Datenbankserver ist fehlgeschlagen"); 
mysql_select_db($db) or die ("Die benötigte Datenbank konnte nicht gefunden werden"); 
 
echo 
"<a href=\"index.php?show=0\">",$home,"</a> - "
 
 
if(empty(
$show)) 

$get_main=mysql_query ("SELECT * FROM $maintable ORDER BY ID"); 
while (
$row=mysql_fetch_object($get_main)) 

echo 
"<a href=\"index.php?show=",$row->ID,"&",$row->LINK,"\">",$row->NAME,"</a> - "


 
if (!empty(
$show)) 

$upper_main=mysql_query ("SELECT * FROM $maintable WHERE ID < $show ORDER BY ID"); 
while (
$row=mysql_fetch_object($upper_main)) 

echo 
"<a href=\"index.php?show=",$row->ID,"&",$row->LINK,"\">",$row->NAME,"</a> - "

 
$lower_main=mysql_query ("SELECT * FROM $maintable WHERE ID > $show ORDER BY ID"); 
while (
$row=mysql_fetch_object($lower_main)) 

echo 
"<a href=\"index.php?show=",$row->ID,"&",$row->LINK,"\">",$row->NAME,"</a> - "

$selected_main=mysql_query ("SELECT * FROM $maintable WHERE ID = '$show' ORDER BY ID"); 
while (
$row=mysql_fetch_object($selected_main)) 

echo 
"<b><a href=\"index.php?show=",$row->ID,"&",$row->LINK,"\">",$row->NAME,"</a></b> - "

 
echo 
"<p>"
$sub=mysql_query ("SELECT * FROM $subtable WHERE MAIN = '$show' ORDER BY MAIN"); 
while (
$row=mysql_fetch_object($sub)) 

echo 
"<a href=\"index.php?show=",$row->ID,"&",$row->LINK,"\" target=\"_self\" style=\"font-size=8pt;\">",$row->NAME,"</a> - "

 
 
echo 
"<p>"
$sub2=mysql_query ("SELECT * FROM $subtable2 WHERE MAIN = '$show' ORDER BY MAIN"); 
while (
$row=mysql_fetch_object($sub2)) 

echo 
"<a href=\"index.php?show=",$row->ID,"&",$row->LINK,"\" target=\"_self\" style=\"font-size=8pt;\">",$row->NAME,"</a> - "

 
 
 
 

?>

The menu`s are in i 3 levels - Topmenu -> submenu -> Sub submenu

I want the Submenu to stay and not go away when i click on a submenu.
How can I do that ?

Last edited by SirFirekicker; 07-12-2008 at 09:08 PM..
SirFirekicker is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 07-12-2008, 12:31 PM Re: php/msql menu problem
dansgalaxy's Avatar
Defies a Status

Posts: 6,521
Name: Dan
Location: Swindon
Trades: 0
Please stick php on [*php] [/php*] (without *'s) makes much easier to read. i will look then too lazy to bother with the tiny little laptop im on at the moment :P

Dan
__________________
Discounted Web Hosting With XDnet!
>> Get 25% of hosting~ Promo: Webmaster-talk <<

Please login or register to view this content. Registration is FREE
dansgalaxy is offline
Reply With Quote
View Public Profile Visit dansgalaxy's homepage!
 
Reply     « Reply to php/msql menu problem
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.16299 seconds with 12 queries