Loading

Photo Gallery Using PHP/MySQL and jQuery

Submitted by: 
Language: 
Visitors have accessed this post 11187 times.


This is a simple gallery using php and jquery. In this code you will learn on how to combine php and jquery to create a simple but powerful gallery. This is unique with other gallery out there because this gallery has a database. The image source of this gallery comes from the database. Download this code and try this on your own to see how php and jquery works. Leave comment if you have question and suggestion in this code, happy coding and hope this code will help you.



Download Code: 

Note: Due to the size or complexity of this submission, the author has submitted it as a .zip file to shorten your download time. After downloading it, you will need a program like Winzip to decompress it.

Virus note: All files are scanned once-a-day by SourceCodester.com for viruses, but new viruses come out every day, so no prevention program can catch 100% of them.

FOR YOUR OWN SAFETY, PLEASE:

1. Re-scan downloaded files using your personal virus checker before using it.
2. NEVER, EVER run compiled files (.exe's, .ocx's, .dll's etc.)--only run source code.

Comments

First of all, thank you for sharing this, everything seems to be great but, I'm having some troubles when I try to import the .sql file to my PhpMyadmin, it throws this:

SQL query:

--
-- Database: `photoupload`
--
-- --------------------------------------------------------
--
-- Table structure for table `photos`
--
CREATE TABLE IF NOT EXISTS `photos` (
`id` int( 11 ) NOT NULL AUTO_INCREMENT ,
`location` varchar( 100 ) NOT NULL ,
`caption` varchar( 100 ) NOT NULL ,
PRIMARY KEY ( `id` )
) ENGINE = MYISAM DEFAULT CHARSET = latin1 AUTO_INCREMENT =5;

MySQL said: Documentation
#1046 - No database selected

...What can I do to fix it? I want to use this Photo Gallery so much!!

First u make database named photoupload in phpmyadmin and then u try to import the photoupload.sql file......will work 4 sure...

nice work sir

Hi,

Thanks for the code, good stuff.

Question: I'm allowing users to upload photos to my database. The images are stored in a longblob field called 'file_data'. My problem is how to correctly write the php code to populate the gallery with the users images. I can properly select the images from the correct user, this is not a problem, however, I don't know what to replace your 'location' with...

Can you offer any advice?

Thanks in advance...
Ocusfend

Hi,
i need some help.

Can i resize big images when i click to display them in orginal size

Add new comment

Filtered HTML

  • You may insert videos with [video:URL]
  • You can enable syntax highlighting of source code with the following tags: <code>, <blockcode>, <asp>, <c>, <cpp>, <csharp>, <css>, <html4strict>, <java>, <javascript>, <mysql>, <php>, <python>, <sql>, <vb>, <vbnet>. The supported tag styles are: <foo>, [foo].
  • Lines and paragraphs break automatically.

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.