well I'm working on a project , I'm using mysql & php to retrive my data from my table actually I have one table contains these fields image , name , more detail I made a query that will retrive all images on my table and the names , and now I'm trying to make another query and it should work like this: first I wanna retrive my data depends on my first query and after that when I click on any image that I retrieved from the first query it should go to another query which will contains only the image that I clicked on and its name and its details , the problem that I faced is that when I click on any image I got all the images , their names and their details :
my code:
$query = mysql_query("SELECT SQL_CALC_FOUND_ROWS img,name FROM info LIMIT ".$start.", ".$perpage);
while ($row = mysql_fetch_assoc($query)){
$rows_result= mysql_query("select FOUND_ROWS() as r");
$r=mysql_fetch_assoc($rows_result);
$total_rows= $r['r'];
$lastpage = ceil($total_rows / $perpage);
echo'<div class="h" >
<p> <a href="query2.php><img src="/'.$row['img'].'", width=100 height=100 /></a>
<p> '.$row['name'].'</p>
</div>';
} ?>
please help