List the items, with its item name 4 example, and add into the link its id too:
<?php
include_once("connect.php");
$sql="SELECT * FROM items ORDER BY item_name ASC";
$result=mysql_query($sql);
while($rows=mysql_fetch_assoc($result))
{
print "<a href=\"details.php?site=details&id={$rows["id"]}\"> ".$rows["item_name"]."</a><br>\r";
}
?>
details.php contains an if condition.
<?php
if($_GET["site"]=="details" AND isset($_GET["id"]))
{
include_once("connect.php");
$sql="SELECT * FROM items WHERE id=".(int)$_GET["id"];
$result=mysql_query($sql);
if(mysql_num_rows($result)>0)
{
$rows=mysql_fetch_assoc($result);
print "item_name:".stripslashes($rows["item_name"]).":<br>\r";
print "details:".stripslashes($rows["details"])."<br>\r";
}
else
print "No data found";
}
?>