title: Getting the ID of clicked image with PHP and load it's info from MYSQL database
body: <p>I need help with loading specific info for the image that has been clicked. The info is stored into a MYSQL database.</p>
  
  <ol>
  <li>I need to determin which image was clicked, and obtaining the images
  ID</li>
  <li>Then fetch the information about that image from the database</li>
  <li>And the echo out the information about the image</li>
  </ol>
  
  <p>link to image of the database structure: <a href="https://www.dropbox.com/sh/8xrifn64psmc9qh/AAA5j_eous8sBpg4WP0dgrmya?dl=0" rel="nofollow">https://www.dropbox.com/sh/8xrifn64psmc9qh/AAA5j_eous8sBpg4WP0dgrmya?dl=0</a></p>
  
  <p>Thanks! This is the line of code i use to load the images from the database.</p>
  
  <pre><code>$sql="SELECT * FROM klubbar ORDER BY namn ASC";
  $res = mysql_query($sql);
  
  if (!$res) {
     echo "Could not successfully run query ($sql) from DB: " . mysql_error();
     exit;
  }
  
  while ($row = mysql_fetch_assoc($res)) {
     echo '&lt;div class="klubbar"&gt;&lt;a href=""&gt;&lt;img     src="'.$row['bild'].'"alt="'.$row['namn'].'"title="'.$row['namn'].'"/&gt;&lt;/a&gt;&lt;/div&gt;';
  }
  </code></pre>