tudor.totolici Posted October 4, 2007 Share Posted October 4, 2007 for now i have this script. it shows the details of the "id" it gets from the url. i want in addition to this a script i want one that shows similar items like "id" and to be able to match them by let's say $tip. i am new to php can u help me pls. <?php $id = $_GET['id']; //Connect to mysql db $conn = mysql_connect("localhost", "user", "pasword") or die("Could not connect: " . mysql_error()); mysql_select_db("database",$conn) or die ("Can\'t use dbmapserver : " . mysql_error()); $result = mysql_query("SELECT * FROM `table` WHERE id = $id",$conn); if (!$result) { echo "no results "; } while($row = mysql_fetch_array($result)) { echo <<<EOF <table width='400' border='0' cellspacing='0' cellpadding='0'><tr><td valign='top' style='padding: 10px 10px 10px 4px;'> <h2 style="font-size: 26px;" class='title'>$row[tip]</h2><br /> <p style="font-size: 16px;" class='desc'><strong>Pret:</strong><br />$row[pret]</p> <p style="font-size: 16px;" class='desc'><strong>Detaliile ofertei:</strong><br />$row[description]</p> <p style="font-size: 16px;" class='desc'><strong>Date de contact:</strong><br /> $row[telefon]; <a href="mailto:$row[email]">$row[email]</a></p> </td></tr> </table> EOF; } ?> Link to comment https://forums.phpfreaks.com/topic/71771-help-with-similar-items/ Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.