Schlo_50 Posted April 1, 2007 Share Posted April 1, 2007 I want to parse product id's to a URL so that one page loads up for every item clicked on. The problem is i don't know how to add this ( <a href="http://blah.freehostia.com/ringdetail.php?ring_id="> ) html link into my PHP code. This is where i am at, at the moment. Could someone revise the code for me please? { echo $row['ring_id']. ' <img src="'. $row['image'] . '" />' '<a href="http://blah.freehostia.com/ringdetail.php?ring_id=">' . $row['desc'] . '</a>' . $row['price'] . "<br />\n"; } ?> Thanks in advance! Link to comment https://forums.phpfreaks.com/topic/45134-item-details/ Share on other sites More sharing options...
hackerkts Posted April 1, 2007 Share Posted April 1, 2007 Ok let's say you have all your items inside the database, then you just need to query out the item id and place it onto the link itself. <?php $query = "SELECT * FROM `table`"; $result = mysql_query($query); $row = mysql_fetch_assoc($result); echo '<a href="http://blah.freehostia.com/ringdetail.php?ring_id'.$row['Item_ID'].'">'.$row['Item_Name'].'</a>'; ?> Hope that helps. Link to comment https://forums.phpfreaks.com/topic/45134-item-details/#findComment-219094 Share on other sites More sharing options...
Schlo_50 Posted April 1, 2007 Author Share Posted April 1, 2007 Could <a href="http://blah.freehostia.com/ringdetail.php?ring_id not just be added after the echo? ??? mysql_connect ($host,$user,$pass) or die ( mysql_error ()); mysql_select_db ($db)or die ( mysql_error ()); $result = mysql_query ($show_all) or die ( mysql_error ()); while ($row = mysql_fetch_array ($result)) { echo $row['ring_id']. ' - <img src="'. $row['image'] . '" />' . $row['desc'] . ' - ' . $row['price'] . "<br />\n"; } Link to comment https://forums.phpfreaks.com/topic/45134-item-details/#findComment-219105 Share on other sites More sharing options...
neel_basu Posted April 1, 2007 Share Posted April 1, 2007 First Try this and tell the output <?php include_once('path/config.php'); include_once('path/db/browse.php'); include_once('path/done.php'); $conn = mysql_connect("localhost", "root", ""); $test = new browse("db_name", "table_name", $conn);//db_name, table_name, $conn $test->set("db_ring_id", $_GET['id']);//Set The GIVEN Fields, and its Value $test->find();//Find All Fields $result = $test->adv_output(); print_r($result); ?> Here path is where you have extracted the Zip Archive. Download The Zipped Archive from here http://sourceforge.net/project/showfiles.php?group_id=192566 Please Download The latest Version 1.0.0.1 For more info Link to comment https://forums.phpfreaks.com/topic/45134-item-details/#findComment-219191 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.