SitePoint Sponsor

User Tag List

Results 1 to 7 of 7
  1. #1
    SitePoint Zealot
    Join Date
    Mar 2010
    Posts
    197
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    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...

  2. #2
    SitePoint Wizard silver trophybronze trophy Cups's Avatar
    Join Date
    Oct 2006
    Location
    France, deep rural.
    Posts
    6,869
    Mentioned
    17 Post(s)
    Tagged
    1 Thread(s)
    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>";

  3. #3
    SitePoint Member somnambul's Avatar
    Join Date
    May 2010
    Posts
    10
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

  4. #4
    SitePoint Zealot
    Join Date
    Mar 2010
    Posts
    197
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    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... :-)

  5. #5
    SitePoint Zealot
    Join Date
    Mar 2010
    Posts
    197
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    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...

  6. #6
    SitePoint Zealot
    Join Date
    Mar 2010
    Posts
    197
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Cups View Post
    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>";
    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...

  7. #7
    SitePoint Wizard silver trophybronze trophy Cups's Avatar
    Join Date
    Oct 2006
    Location
    France, deep rural.
    Posts
    6,869
    Mentioned
    17 Post(s)
    Tagged
    1 Thread(s)
    Quote Originally Posted by rajeevthomas View Post
    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...
    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


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •