Jump to content

Navigation/structure problem


t.bo

Recommended Posts

Hello everybody,

 

Im making a website that has a menu that consists of several treatements when u click on one treatment a submenu appears that everytime has a "info" , "price", "pictures" button about that treatment.

Now I was wondering what is the best way to solve this in php/mysql. My idea was to make one table for each treatment that consists of an idfield, an infofield, pricefield and picturefield.

That way I can do a link like this index?content=botox&action=price

where botox.php would be like this :

 

<?
include('dbconnect.php');
$action = $_GET[action];
if($action == "") {
$action = "info";
} else {
$sql = mysql_query("SELECT * FROM treatmenttable WHERE actionfield='$action'") or die(mysql_error());
$r=mysql_fetch_array($sql);
$info = mysql_result($sql, 0 ,"info");
$price = mysql_result($sql, 0 ,"price");
$picture = mysql_result($sql, 0 ,"picture");
if($action = "info"){
echo "$info";
}
if($action = "price"){
echo "$price":
} 
}
?>

 

Im having a little problem displaying the output (price, info or pictures) so im little stuck with the last lines.

Can anyone help me out?

Thanks in advance...

 

ps : u can find an example of the layout here : http://euroclinix.site2start.be/euronew/

 

Link to comment
https://forums.phpfreaks.com/topic/78785-navigationstructure-problem/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.