title: PHP/MYSQL : Dynamic jquery group lightbox images
body: <p>i have this jquery function for show image gallery when click in button (static image). so this worked 100% for me : </p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
    jQuery(document).ready(function($){
      $("#gallery").click(function() {
        $.lightbox(["assets/4.jpg", "assets/3.jpg", "assets/6.jpg"]);
        return false;
      });
    });
  &lt;/script&gt;
  </code></pre>
  
  <p>now i have dynamic image gallery using <code>PHP</code> / <code>MySQL</code> / <code>smarty</code> / <code>ADODB</code>.</p>
  
  <p>my PHP Code is : </p>
  
  <pre><code>$aid        = intval($aid);
  $sql            = "SELECT PID, caption FROM photos WHERE AID = " .$aid. " AND status = '1' LIMIT " .$limit;
  $rs             = $conn-&gt;execute($sql);
  $photos         = $rs-&gt;getrows();
  $smarty-&gt;assign('photo', $photos);
  // Other Smarty Engine Code
  </code></pre>
  
  <p>My TPL smarty is : </p>
  
  <pre><code>{if $photos}
  {section name=i loop=$photos}
  &lt;img src="{$relative}/media/photos/tmb/{$photos[i].PID}.jpg" alt="{$photos[i].caption|escape:html}" width="160" height="120" id="album_photo_{$photos[i].PID}" /&gt;
  {/section}
  {/if}
  </code></pre>
  
  <p>Now! i need To Generate/Print loop img Address to jquery <code>function($lightbox(["dynamic.jpg","dynamic1.jpg","dynamic2.jpg"]);)</code> for dynamic jquery lightbox group. </p>
  
  <p>How To generate this?! Thanks For Any Idea &amp; help.</p>