Search found 7 matches

by tux
Fri Sep 30, 2011 9:20 am
Forum: PHP coding => Images
Topic: Selecting 1 Record from multiple galleries in same table
Replies: 12
Views: 3397

Re: Selecting 1 Record from multiple galleries in same table

Thanks for that Nullsig,

Its always good to learn something new everyday. You have been my tutor for today, thank you.

Next time I have something I don't understand I'll be sure to come back.

Take care.

Paul
by tux
Fri Sep 30, 2011 1:16 am
Forum: PHP coding => Images
Topic: Selecting 1 Record from multiple galleries in same table
Replies: 12
Views: 3397

Re: Selecting 1 Record from multiple galleries in same table

Thanks Nullsig, It worked perfectly. I changed it so that MIN is MAX so I get the latest images and removed the stuttering AND hehe! Nullsig, could I ask you to go through the logic of this code with me. I get INNER JOINS but have not used nested selects and group by before and don't get how you hav...
by tux
Thu Sep 29, 2011 6:01 am
Forum: PHP coding => Images
Topic: Selecting 1 Record from multiple galleries in same table
Replies: 12
Views: 3397

Re: Selecting 1 Record from multiple galleries in same table

Thanks Nullsig,

I will give it a try when I get home and let you know how I get on.

Regards, Paul
by tux
Wed Sep 28, 2011 2:00 pm
Forum: PHP coding => Images
Topic: Selecting 1 Record from multiple galleries in same table
Replies: 12
Views: 3397

Re: Selecting 1 Record from multiple galleries in same table

wp_ngg_gallery
gid|name|slug|path|title|

wp_ngg_pictures
pid|image_slug|postid|galleryid|filename|description


They are related by the 'gid' and the 'galleryid'

Thanks
by tux
Wed Sep 28, 2011 12:23 pm
Forum: PHP coding => Images
Topic: Selecting 1 Record from multiple galleries in same table
Replies: 12
Views: 3397

Re: Selecting 1 Record from multiple galleries in same table

Cant seem to get this to work. Here is my actual table and field names. The gallery table is.... 'wp_ngg_gallery' and the ID field is 'gid' (used for getting user info and gallery info) The images table is.... 'wp_ngg_pictures' and its ID field is 'galleryid' (used for getting image info for each ga...
by tux
Wed Sep 28, 2011 12:06 pm
Forum: PHP coding => Images
Topic: Selecting 1 Record from multiple galleries in same table
Replies: 12
Views: 3397

Re: Selecting 1 Record from multiple galleries in same table

Thanks for your speedy reply. I will give it a bash and see how I get on.

Regards, Paul
by tux
Wed Sep 28, 2011 11:44 am
Forum: PHP coding => Images
Topic: Selecting 1 Record from multiple galleries in same table
Replies: 12
Views: 3397

Selecting 1 Record from multiple galleries in same table

Hello everyone, new here. I'm finding this hard to explain. Scenario. I have 2 tables, one for galleries and one for images. The gallery table holds the info for the gallery owner. The images table holds the image info linked by the galleryID. I want to query the image table so that I select just th...