title: Create Thumbnails from a folder of images using PHP
body: <p>I have a folder of jpegs, and a MySQL database that I hope to use to manage them. The database has one table: 'images', and 7 fields: 'imgID', 'imgTitle', 'imgURL', 'imgDate', 'imgClass', 'imgFamily', &amp; 'imgGender'. The primary key is 'imgID' and the Index Key is 'imgDate'.</p>
  
  <p>What I would like to do is create a PHP file that will go through my folder of images (all jpegs), and create thumbnails of them, which can then be used when displaying links to the images on my webpage. As I will be adding more images to the folder in the future, it would be good to prevent the code from creating doubles of images it has already created thumbnails of.</p>
  
  <p>All literature I have come across recommends using the gd images library to do this, but I'm open to suggestions.</p>
  
  <p>As I'm new to both MySQL and PHP, I was hoping someone could help me with the code. Everything I have tried has failed.</p>
  
  <p>the directory where the images are located is new_arrivals_img/ relative to the site root, and the thumbnails should be placed in new_arrivals_img/thumbnails/ also relative to the site root.</p>
  
  <p>Right now I'm building the site, and thus using MAMP to host it locally. I have had some problem figuring out relative paths for my images. Is there a way to set new_arrivals_img/ as the root?</p>