DR.Wong
10-30-2006, 03:50 PM
Hey everyone.
I have asked this question somewhere here before and was just told to learn more about database normalisation. Yeah.. that didnt really help.
I have looked around a lot and tried a few things but there is something that I cannot figure out (it must be simple though) and btw I hope this is the right catagory to post this in.
What I want to do:
I have a MySQL database full of news entries. The table layout for these entries is as follows:
1) ID // Primary Key // Auto Increment // INT
2) Title // VARCHAR
3) Text // TEXT
The unique ID's may not be completely chronologically true as entries are added and more importantly DELETED on a regular basis, so it may happen that the ID's go : 1,2,5,6,9 and not 1,2,3,4,5.
These ID's also cannot be 'reset' or ordered again as to make the pattern complete as the ID is used to reference comments joined in a seperate table.
All I want to do is show 5 entries per a page and have a 'Next 5' and if relevant 'Previous 5' link on the bottom of my page.
An idead I had was simply to add a nother column to my table as a 'countID' that can be re-ordered at will to allow for additions and subtractions and a complete number pattern, but I do not know how to 'reset' a column.
If you have a solution to my query or can point me in the right direction, please do!!
Thanks a lot!
I have asked this question somewhere here before and was just told to learn more about database normalisation. Yeah.. that didnt really help.
I have looked around a lot and tried a few things but there is something that I cannot figure out (it must be simple though) and btw I hope this is the right catagory to post this in.
What I want to do:
I have a MySQL database full of news entries. The table layout for these entries is as follows:
1) ID // Primary Key // Auto Increment // INT
2) Title // VARCHAR
3) Text // TEXT
The unique ID's may not be completely chronologically true as entries are added and more importantly DELETED on a regular basis, so it may happen that the ID's go : 1,2,5,6,9 and not 1,2,3,4,5.
These ID's also cannot be 'reset' or ordered again as to make the pattern complete as the ID is used to reference comments joined in a seperate table.
All I want to do is show 5 entries per a page and have a 'Next 5' and if relevant 'Previous 5' link on the bottom of my page.
An idead I had was simply to add a nother column to my table as a 'countID' that can be re-ordered at will to allow for additions and subtractions and a complete number pattern, but I do not know how to 'reset' a column.
If you have a solution to my query or can point me in the right direction, please do!!
Thanks a lot!