...

View Full Version : How to build a view merge all and order by creation date?



bigtiger
11-01-2006, 07:59 AM
hi, I'am creating a small photo album that will placed on my site for upload photo. What I'am did is a basic table structure and can have albums and photos displayed seperately.
But when I have a look at other photo forums. That can have albums and photos displayed together and ordered by creation date as the image attached.
Let's me make it clear, what I'am said is a album could hold another albums and photos.
But for now, I just could display albums first, then photos. And I wish to displayed all following the creation order, such as :

1.) added a new album
2.) added a new photo
3.) added a new album

and the display should be :
[new album1] - [new photo1] - [new album2]



create table pbm_album (
id tinyint(8) auto_increment,
pbm_parent_id tinyint(8) not null
pbm_name varchar(50) not null,
pbm_description varchar(100) null,
primary key(id)
);

create table pbm_photo (
id tinyint(8) auto_increment,
pbm_album_id tinyint(8) not null
pbm_name varchar(50) not null,
pbm_title varchar(50) not null,
pbm_description varchar(100) null,
foreign key pbm_album_id references pbm_album(id),
primary key(id)
);

hmm... Also, Is there any suggestion about these tables and design issues?

Thanks,
Eric,

bigtiger
11-01-2006, 10:28 AM
I do know how to display albums information when there is no photos inside it. But when a album do hold both albums and photo. I'am just confuse how to do that. Any help?



Thanks,
Eric,



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum