Another newbie...Gallery with categories?

Hi … I am a total newbie. I have been trying to build a simple gallery with Dreamweaver and a database. I am able to show larger image, from thumbs. I used a database, recordset, repeat regions. But I do not know how to show categories. Can anyone give me any directions? Any tutorials? The gallery tutorial here from Mayank is beyond my capabilities. I am ready to provide you with any info you need… please help…:shifty:

Cups… I finally created a database with categories…

Table 1 -
Database: photo_gallery
Generation Time: Jun 16, 2010 at 07:25 AM
Generated by: phpMyAdmin 3.2.0.1 / MySQL 5.1.36-community-log
SQL query: describe categories;
Rows: 3

Field Type Null Key Default Extra
id int(11) unsigned NO PRI /NULL/ auto_increment
description varchar(100) NO
preview varchar(64) NO

Table 2 -
Host: localhost
Database: photo_gallery
Generation Time: Jun 16, 2010 at 07:29 AM
Generated by: phpMyAdmin 3.2.0.1 / MySQL 5.1.36-community-log
SQL query: describe photos;
Rows: 4

Field Type Null Key Default Extra
id int(11) unsigned NO PRI /NULL/ auto_increment
filename varchar(64) NO
comment varchar(255) YES /NULL/
category_id int(11) unsigned NO 0

Once again I hope this is the info you asked for. I just need help to show the categories using php…

OK, so now you have some categories, good start.

Make sure you have some reasonably test data in the tables.

How to show the categories? “Select * from categories”

with that result set, lets say using straight PHP mysql_* functions getting arrays, you need to then loop through that result set and generate the following URLS:

<a href=image.php?cat=1>Category 1</a>

Where image.php checks whether the $_GET[‘cat’] variable is set, that it is within bounds, and then gets all the images from your table whose category_id is 1

somnambul…that’s the exact tutorial I mentioned in my question that I didn’t understand at all… I was stuck with many errors… thank you for trying to help though…

Cups… I have couple of different tables… I just came to know that I need category table… I know I know I am a bit slow. The tables I have

gallerythumbs -

Field Type Null Key Default Extra
id int(11) NO PRI /NULL/ auto_increment
gallerytitle text NO /NULL/
gallerythumbs varchar(400) NO MUL /NULL/

Another thumbs table

Field Type Null Key Default Extra
id int(11) NO PRI /NULL/ auto_increment
gallgeneraldescriptions text NO /NULL/
thumbsimage varchar(400) NO MUL /NULL/
thumbscaptions text NO /NULL/

I hope I am giving you the information you needed… I will create a category table and I will post. Thank you for your help… :slight_smile:

So do you have categories already set in your database?

Show us a row or two then, and the result of querying your database with the command “describe <table_name>”;

Ycan find good example here http://articles.sitepoint.com/article/php-gallery-system-minutes