Title: [Plugin: NextGEN Gallery] Fetch data programatically, from the template files
Last modified: August 19, 2016

---

# [Plugin: NextGEN Gallery] Fetch data programatically, from the template files

 *  Resolved [anothertrad](https://wordpress.org/support/users/anothertrad/)
 * (@anothertrad)
 * [16 years ago](https://wordpress.org/support/topic/plugin-nextgen-gallery-fetch-data-programatically-from-the-template-files/)
 * Hi, I just need a way to fetch a specifically gallery by name and be able to 
   iterate over the pictures/thumbnails/link*, and do whatever I can with it.
 * * that would be my “image” object 🙂
 * [http://wordpress.org/extend/plugins/nextgen-gallery/](http://wordpress.org/extend/plugins/nextgen-gallery/)

Viewing 3 replies - 1 through 3 (of 3 total)

 *  Thread Starter [anothertrad](https://wordpress.org/support/users/anothertrad/)
 * (@anothertrad)
 * [16 years ago](https://wordpress.org/support/topic/plugin-nextgen-gallery-fetch-data-programatically-from-the-template-files/#post-1511225)
 * ok, done with simple wpdb
 *  Thread Starter [anothertrad](https://wordpress.org/support/users/anothertrad/)
 * (@anothertrad)
 * [16 years ago](https://wordpress.org/support/topic/plugin-nextgen-gallery-fetch-data-programatically-from-the-template-files/#post-1511226)
 * for the record:
 *     ```
       $ngggalleryname = 'test';
       $previewpicdata = $wpdb->get_row(" SELECT * FROM $wpdb->nggallery  where name='$ngggalleryname'");
       $images = $wpdb->get_results(" SELECT * FROM $wpdb->nggpictures  where galleryid=$previewpicdata->gid");
       ```
   
 * foreach…`
 *  [Alex Rabe](https://wordpress.org/support/users/alexrabe/)
 * (@alexrabe)
 * [16 years ago](https://wordpress.org/support/topic/plugin-nextgen-gallery-fetch-data-programatically-from-the-template-files/#post-1511286)
 * Or you use this way : `nggdb::get_gallery( $galleryID )`

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘[Plugin: NextGEN Gallery] Fetch data programatically, from the template
files’ is closed to new replies.

 * 3 replies
 * 2 participants
 * Last reply from: [Alex Rabe](https://wordpress.org/support/users/alexrabe/)
 * Last activity: [16 years ago](https://wordpress.org/support/topic/plugin-nextgen-gallery-fetch-data-programatically-from-the-template-files/#post-1511286)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
