nritchie2004 Posted June 9, 2006 Share Posted June 9, 2006 Hi, I hope someone can help me here, Id really like to be able to have on my site a link which then opens another page, but with more details than the previous. eg: I have a page which outputs boats from the database, and the things shown are Boat Name, Boat Type, and Price, and then under this i would like a link, that open a page which shows Boat Name, Boat Type, Price, Features and Description. How would i go about doing this? Quote Link to comment https://forums.phpfreaks.com/topic/11565-show-more-details/ Share on other sites More sharing options...
joquius Posted June 9, 2006 Share Posted June 9, 2006 for the first page output the boats as an array of the boat list[code]<table><?$sql = mysql_query ("select * from `boats` WHERE 1 ORDER BY `added_time` DESC LIMIT 0, 10");if ($mysql_num_rows ($sql) != 0){ while ($sql_data = mysql_fetch_array ($sql)) { ?><tr><td><a href="?boat=<?=$sql_data['boat_id']?>"><?=$sql_data['boat_name']?></a></td></tr><? }}?></table>[/code]the other page:[code]<? if (!isset ($_GET['boat']) || !mysql_result (mysql_query ("select `boat_id` from `boats` where `boat_id` = '".$_GET['boat']."'"), 0)) die ("No boat selected");$boat_data = mysql_fetch_array (mysql_query ("select * from `boats` where `boat_id` = '".$_GET['boat']."'"));?><?=$boat_data['boat_name']?><?=$boat_data['boat_length']?>...etc[/code]The thing to remember is just have the main page listing and the second selecting. The first page here selects a certain range from the list of boats, giving you a link which includes the boat_id from the DB, letting the other page know what information to retreive. Quote Link to comment https://forums.phpfreaks.com/topic/11565-show-more-details/#findComment-43572 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.