title: retrieve image from mysql database to array php
body: <p>By compiling this, display three image get my database and show it, when i click each image popup window show last image of my database.I want to know how to display the particular image, when i click first image,then popup window show first image and description, as well as same way second and third image. check to array loop in this code...</p>
  
  <pre><code>enter code here
  &lt;?php
              $sql=mysql_query("select * from product_reg")or die(mysql_error());
              while($row=mysql_fetch_array($sql))
              {
                  $productname=$row['productname'];
                  $productid=$row['productid'];
                  $description=$row['description'];
                  $image=$row['image'];
  
  
                  $firstN = array();
                  $i=0;
                  $firstN = '&lt;img src="'.$row ['image'].'"&gt;';
                  echo '  &lt;a href="#" class="big-link" data-reveal-id="myModal" name="image" style="float:left;margin:100px 0 100px 100px;"&gt; ' ;  echo $productname;echo $firstN[$i];
                  $r=$firstN[$i];
                  echo '&lt;/a&gt;';
                  $i++;
  
              }
  
      ?&gt;
  
  
          &lt;div id="myModal" class="reveal-modal"&gt;
          &lt;form&gt;
          &lt;table&gt;
          &lt;tr&gt;&lt;td&gt;&lt;?php   echo $r; ?&gt;&lt;/td&gt;
              &lt;td&gt;&lt;h1&gt;Reveal Modal Goodness&lt;/h1&gt;
              &lt;p&gt;This is a default modal in all its glory, but any of the styles here can easily be changed in the CSS.&lt;/p&gt;&lt;/td&gt;
              &lt;a class="close-reveal-modal"&gt;&amp;#215;&lt;/a&gt;
          &lt;/div&gt;
  
      &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>