hi i'm new with php and i really don't know ajax. i making a photo gallery site i used the code below to display my photos i need to make possible with ajax or any other language, when someone click on the photo in index.php with the title example:"happy day 2012" want the photo being displayed in another page example:"photo/happy-day-2012"
<?php
$link = mysql_connect("localhost", "root","");
mysql_select_db("test", $link);
$query = "select * from post order by id DESC;";
$results = mysql_query($query, $link) or die ("error!".mysql_error());
if($results){
$i = 1;
while ($row = mysql_fetch_assoc($results)){
echo $row['title']. "<img src=/1/" . $row['location']."width=580px>"."<br/><br/><br/>";
}
}
?>
Please if possible can use lot of comments on the code.