Page: 1
fuse 1 year 10 months ago wrote:
Each time I learn something new related to PHP/MySQL/CSS/Javascript, I will post it here.

Generating previous and next buttons for a none sequential DB, using an auto-incremential primary key:
SELECT * FROM table WHERE field_id<>2 ORDER BY field_id LIMIT 2;

Why is this important do you ask? Because sometimes when you run a database, even if you have an auto-incrementing primary key, sometimes records get deleted for whatever reason leaving gaps between id records. Ex. You have 10 records in your database, the identifier key spans 1-10. You delete record 5. Now visit record 4, and when you click the next button, it selects record 5. As we know we just deleted this record...uh-oh. It really should be skipping to record 6. Now I go and visit record 6, I hit previous... uh-oh, another broken end. This query will select only the next possible record, sequentially (based on ithe primary auto-increment identifier). Even if gap in sequence exists, it will skip on to the next possible record.
Food for thought:
- The three most important things are: love, knowledge, and truth.
- To be remembered is to live forever.
- It's all about perspective, try to be grateful about life.
- Love happens by accident
Gaming:
DMS3 Modchipped PS2Slimline FTW, the Wii is cool too Smile
users/fuse/forums/fuse_siggy.jpg
anadorn 1 year 10 months ago wrote:
Wow.. This might come in handy since I'm gonna take CompSci...

Neat Fuse! Your the best!!!
http://i101.photobucket.com/albums/m70/anadorn/Avatar%20and%20sigs/2e780cda.jpg
Dynewind 1 year 10 months ago wrote:
huh
i took web design but not really far..... just basic and some flash
and i dont have any idea of what u typed lolTickled Pink
Israel 1 year 10 months ago wrote:
nice info fuse!!!


btw what does .dll mean?
Normal is synonymous to boring

http://photos.friendster.com/photos/23/28/40088232/568166984l.jpg
fuse 1 year 10 months ago wrote:
dll are dynamic link libraries. It's windows way of adding functionality to programs. Such as a graphical users dll would control the generation of the visual layout of a program. So when a programmer comes around they don't need to write their own, but instead can use it. Saves time and energy so programmers can invest more time into more robust features for their programs.

That is just one application.
Food for thought:
- The three most important things are: love, knowledge, and truth.
- To be remembered is to live forever.
- It's all about perspective, try to be grateful about life.
- Love happens by accident
Gaming:
DMS3 Modchipped PS2Slimline FTW, the Wii is cool too Smile
users/fuse/forums/fuse_siggy.jpg
Page: 1