Ok im a super newb and i dont know how to to reference the data in my mysql table. I wrote a code that uploads a file to a server then to a database where its echoed out afterwards. The code also echoes out the id in the table's field so i know the id but i dont know how to afterwards reference it in the url. It's prob really basic but i can't figure it out. Can someone help me out or hint. Would be very appreciated. Here's the code
<?php
$conn=mysql_connect("localhost","root","");
$select=mysql_select_db("project",$conn);
$title=$_POST['title'];
$pic=$_FILES['pic']['tmp_name'];
$pic2=$_FILES['pic']['name'];
$desc=$_POST['desc'];
$path="upload/".$pic2;
$themove=move_uploaded_file($pic,$path);
$sqlqry=mysql_query("INSERT INTO media(title,pic,desct) VALUES ('$title','$path','$desc')");
echo $hmmm=mysql_insert_id($conn);
$searr="SELECT * FROM media WHERE id='$hmmm'";
$seartt=mysql_query($searr);
$burp=mysql_fetch_array($seartt);
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>New Uploaded Page</title>
</head>
<body>
<a href="#"><h1><?php echo $burp['title']; ?></h1></a><br /><br />
<img src="<?php
echo $burp['pic'];
?>" /><br /><p><br /><?php
echo $burp['desct'];
?></p>
</body>
</html>