Image download from mysql results

Posted by rozatrra on Stack Overflow See other posts from Stack Overflow or by rozatrra
Published on 2014-06-08T09:45:36Z Indexed on 2014/06/10 21:25 UTC
Read the original article Hit count: 124

Filed under:
|

i need to give my users the opportunity to download all the images I display in my project. images are displayed from a mysql query like this:

$query = mysql_query("SELECT tl.customername, tl.visitdate, tl.employeename, pz.webpath from table tl
                    inner join pictures pz on pz.visitid = tl.visitid and pz.groupid = tl.groupid
                    inner join agenti ag on ag.idh = tl.employeeid
                    WHERE tl.visitdate >= '$from' AND tl.visitdate <= '$to' 
                    AND tl.employeename like '$r_employee' 
                    AND tl.customerowner like '$r_customer'
                    AND tl.customername like '$r_customername' 
                    AND tl.visitdate like '$r_date' 
                    group by pz.webpath order by tl.customername") or die(mysql_error());
while( $associate = mysql_fetch_assoc($query)) {
                                echo '<li> <figure>
                                          <img src="../core/includes/timthumb.php?src='.$associate['webpath'].'&w=200&h=200" />
                                          <figcaption>
                                              <h3>'.$associate['customername'].'</h3>
                                              <h6>'.$associate['employeename'].'</h6>
                                              <h6>'.$associate['visitdate'].' </h6>
                                     '; 
                                echo '<a class="fancybox" rel="gallery" href="'.$associate['webpath'].'" title=" '.$associate['visitdate'].' / '.$associate['customername'].'">Big picture</i></a>';
                                echo '</figcaption>
                                      </figure>
                                  </li>';
                            $zip->addFromString(pathinfo ( urldecode($associate['webpath']), PATHINFO_BASENAME), urldecode($associate['webpath']));
                            } 

How can i add a download button which will save all the images as zip on user computer?

© Stack Overflow or respective owner

Related posts about php

Related posts about mysql