Jump to content

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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.