javascript - retrive data from other query in php -


well i'm working on project , i'm using mysql & php retrive data table have 1 table contains these fields image , name , more detail made query retrive images on table , names , , i'm trying make query , should work this: first wanna retrive data depends on first query , after when click on image retrieved first query should go query contains image clicked on , name , details , problem faced when click on image got images , names , details :

my code:

     $query = mysql_query("select sql_calc_found_rows img,name info limit ".$start.", ".$perpage);   while ($row = mysql_fetch_assoc($query)){      $rows_result= mysql_query("select found_rows() r");    $r=mysql_fetch_assoc($rows_result);    $total_rows= $r['r'];    $lastpage = ceil($total_rows / $perpage);     echo'<div class="h" >            <p>  &nbsp; <a href="query2.php><img src="/'.$row['img'].'", width=100 height=100 /></a>         <p> '.$row['name'].'</p>    </div>';  } ?> 

please

you can store image's id (or name, use unique key) somewhere , select it.

for example, if have table 'image_id' being unique id of image, can use where operator image want this:

select * info image_id='1337'

1337 selected image id.


Comments

Popular posts from this blog

c# - DetailsView in ASP.Net - How to add another column on the side/add a control in each row? -

javascript - firefox memory leak -

Trying to import CSV file to a SQL Server database using asp.net and c# - can't find what I'm missing -