php - Get value from database after clicking on image -


i have query gets latest 10 rows in table , loops 10 times echo html includes of information taken table, similar below (pseudo code):

query = <get 10 latest rows table>  $name = <one value table>; $name2 = <another value table>;  echo '<div class="style1">' . $name . '</div> <a href=""><img src="image.png" /></a> <div class="style2">' . $name2 . '</div>'; 

what i'm having trouble that, if user clicks image, need run ajax show piece of html based on variable $name.

the problem that, since i'm echoing 10 rows table, how can value of 1 variable when image clicked?

please help!

give each div id based on value of $name. , use $name ajax call next step.


Comments

Popular posts from this blog

html - How to style widget with post count different than without post count -

How to remove text and logo OR add Overflow on Android ActionBar using AppCompat on API 8? -

javascript - storing input from prompt in array and displaying the array -