MySQL
  Home arrow MySQL arrow Page 6 - Online Photo Album Development using P...
Dev Shed Forums 
Administration  
AJAX  
Apache  
BrainDump  
DHTML  
Flash  
Java  
JavaScript  
Multimedia  
MySQL  
Oracle  
Perl  
PHP  
Practices  
Python  
Reviews  
Security  
Style-Sheets  
Web Services  
XML  
Zend  
Zope  
Forums Sitemap 
IBM® developerWorks 
Sun Developer Network 
E-Commerce Hosting 
Linux Web Hosting 
Managed Hosting 
Small Business Hosting 
Mobile Linux 
App Generation ROI 
VPS Hosting 
Weekly Newsletter

 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
MYSQL

Online Photo Album Development using PHP and GD: Part 1
By: Frank Manno
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 4 stars4 stars4 stars4 stars4 stars / 36
    2004-04-22

    Table of Contents:
  • Online Photo Album Development using PHP and GD: Part 1
  • Photo Sizing
  • Photo Class
  • To Gif or Not to Gif
  • Resizing Images
  • Conclusion

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT


    Online Photo Album Development using PHP and GD: Part 1 - Conclusion


    (Page 6 of 6 )

    Database Snapshots

    We need to create our database structure. We have many options available to us regarding how we want our images to be organized. I've chosen to go with creating multiple albums, containing multiple images. This will allow for a well-organized gallery, in that we can group related albums together.

    Our database structure will contain the following tables:

    Table Name: album

    Table Name: photo

    We'll now create our tables using MySQL:

    CREATE TABLE album (
    album_id int(11) NOT NULL auto_increment,
    album_name varchar(255) NOT NULL default '',
    album_desc text NOT NULL,
    album_cover varchar(255) NOT NULL default '',
    PRIMARY KEY (album_id),
    KEY album_name (album_name)
    ) TYPE=MyISAM;

    CREATE TABLE photo (
    photo_id int(11) NOT NULL auto_increment,
    photo_title varchar(255) NOT NULL default '',
    photo_desc text NOT NULL,
    photo_date datetime NOT NULL default '0000-00-00 00:00:00',
    photo_location varchar(255) NOT NULL default '',
    thumbnail_location varchar(255) NOT NULL default '',
    album_id int(11) NOT NULL default '0',
    PRIMARY KEY (photo_id),
    KEY photo_title (photo_title),
    ) TYPE=MyISAM;

    An example INSERT query may be something like the following:

    INSERT INTO album VALUES(0, 'Frank's Birthday', 'May contain incriminating photos! :)', 'thumbs/at_the_bar_080103_180743');

    INSERT INTO photo VALUES(0, '1st Drink of Many', 'A Drink with Friends!', '2003-08-03 18:07:43', 'photos/ at_the_bar_080103_180743', 'thumbs/ at_the_bar_080103_180743'', 1);

    Now that our tables have been created, we can worry about the structure of our "back-end interface", which will allow us to upload our images into the chosen album(s).


    DISCLAIMER: The content provided in this article is not warranted or guaranteed by Developer Shed, Inc. The content provided is intended for entertainment and/or educational purposes in order to introduce to the reader key ideas, concepts, and/or product reviews. As such it is incumbent upon the reader to employ real-world tactics for security and implementation of best practices. We are not liable for any negative consequences that may result from implementing any information covered in our articles or tutorials. If this is a hardware review, it is not recommended to open and/or modify your hardware.

     

       

    MYSQL ARTICLES

    - MySQL Server Tuning Tips and Tricks
    - MySQL Query Optimizations and Schema Design
    - MySQL Benchmarking Tools and Utilities
    - MySQL Benchmarking Concepts and Strategies
    - Take Some Load off MySQL with MemCached
    - MySQL Table Prefix Changer Tool in PHP
    - Using the SIGNAL Statement for Error Handling
    - Error Handling Examples
    - Error Handling
    - Completing a Search Engine with MySQL and PH...
    - Paginating Result Sets for a Search Engine B...
    - Building a Search Engine with MySQL and PHP 5
    - Using Boolean Operators for Full Text and Bo...
    - PHP, MySQL and the PEAR Database
    - Working with PHP and MySQL





    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway
    Stay green...Green IT