www.webdeveloper.com
Results 1 to 2 of 2

Thread: Finding Result Row Index?

  1. #1
    Join Date
    Dec 2010
    Posts
    232

    Finding Result Row Index?

    In my site I have an image gallery that shows all of the thumbnails from an album and an enlarged photo of the photo the user has selected.

    I have a query which selects all the photos (objects) from the album the user is currently viewing :-

    Code:
    $result = mysql_query("SELECT objects.object_id FROM objects
    LEFT JOIN objects_albums
    ON(objects_albums.object_id = objects.object_id)
    LEFT JOIN albums
    ON(objects_albums.album_id = albums.album_id)
    WHERE albums.album_id = ?");
    and a query which selects the current photo from the objects table and all it's details based on what thumbnail the user has clicked:-

    Code:
    $result2 = mysql_query("SELECT objects.object_id, object_image FROM objects
    WHERE objects.object_id = ? ");
    
    $row2 = mysql_fetch_array($result2);
    This works fine and allows users to click thumbnails to navigate the photos however I want to display photo indexes i.e. if the user goes to the 10th photo in an album of 17 photos "10 of 17" should be displayed.

    What is the best/most efficient way to achieve this?

  2. #2
    Join Date
    Dec 2010
    Posts
    232
    Anyone?

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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



Recent Articles