Example page for MyPagina class

The page navigation (pagination) of lists with records from a (MySQL) database is often used on a lot of dynamic websites. This class is extremely easy to use in your existing application: just use your own SQL statement and voila you get information like the result set (you need this for later output, page navigation links and the (current) number of records. While using this class all other query string parts are included inside the page links. An example database table (with data) is included.

This information shows the current range of records and the total number of records.

rec. to of 920

 

Here the records (id and titel):

Mon, 30 Apr 9:12:00 PM goose212 Lvl:5 Monster:Wraith Weapon:Flametongue Roll:4 Result:missed Damage:0 HP:4 XP:2000 Cost:8 loot:

Mon, 30 Apr 9:11:54 PM goose212 Lvl:5 Monster:Wraith Weapon:Flametongue Roll:11 Result:dodged a successful attack Damage:0 HP:4 XP:2000 Cost:8 loot:

Mon, 30 Apr 9:11:49 PM goose212 Lvl:5 Monster:Wraith Weapon:Flametongue Roll:7 Result:missed Damage:0 HP:4 XP:2000 Cost:8 loot:

Mon, 30 Apr 5:14:33 PM Diggermoth Lvl:4 Monster:Wraith Weapon:Flametongue Roll:19 Result:dodged a successful attack Damage:0 HP:4 XP:2000 Cost:8 loot:

Mon, 30 Apr 5:14:24 PM Diggermoth Lvl:4 Monster:Wraith Weapon:Flametongue Roll:1 Result:missed Damage:0 HP:4 XP:2000 Cost:8 loot:

Mon, 30 Apr 5:10:53 PM Diggermoth Lvl:4 Monster:Wraith Weapon:Flametongue Roll:13 Result:dodged a successful attack Damage:0 HP:4 XP:2000 Cost:8 loot:

Fri, 27 Apr 5:47:15 PM goose212 Lvl:4 Monster:Wraith Weapon:Flametongue Roll:14 Result:killed Damage:18 HP:-14 XP:2000 Cost:8 loot:19(Loot) 72(Silver) 68(Item) 60 Ruby_Shard

Fri, 27 Apr 5:47:10 PM goose212 Lvl:4 Monster:Wraith Weapon:Flametongue Roll:1 Result:missed Damage:0 HP:4 XP:2000 Cost:8 loot:

Sat, 31 Mar 11:09:53 AM funpenguin Lvl:5 Monster:Hellhound Weapon:Flametongue Roll:1 Result:missed Damage:0 HP:600 XP:0 Cost:8 loot:

Thu, 29 Mar 6:25:57 PM funpenguin Lvl:5 Monster:Wraith Weapon:Flametongue Roll:17 Result:killed Damage:10 HP:-6 XP:2000 Cost:8 loot:57(Loot) 119(Silver) 17(Item) 36 Topaz_Shard

Wed, 28 Mar 8:02:05 PM funpenguin Lvl:5 Monster:Oliphant Weapon:Flametongue Roll:12 Result:hit Damage:8 HP:23 XP:900 Cost:8 loot:

Wed, 28 Mar 8:02:00 PM funpenguin Lvl:5 Monster:Oliphant Weapon:Flametongue Roll:6 Result:hit Damage:11 HP:31 XP:900 Cost:8 loot:

Wed, 28 Mar 8:15:49 AM chaos_angel1 Lvl:4 Monster:Hellspawn Weapon:Flametongue Roll:14 Result:dodged a successful attack Damage:0 HP:800 XP:0 Cost:8 loot:

Tue, 27 Mar 6:49:05 PM funpenguin Lvl:4 Monster:Oliphant Weapon:Flametongue Roll:13 Result:hit Damage:8 HP:13 XP:900 Cost:8 loot:

Tue, 27 Mar 6:48:35 PM funpenguin Lvl:4 Monster:Oliphant Weapon:Flametongue Roll:19 Result:hit Damage:21 HP:21 XP:900 Cost:8 loot:

Wed, 31 Jan 7:05:46 PM Diggermoth Lvl:4 Monster:Wraith Weapon:Flametongue Roll:2 Result:missed Damage:0 HP:4 XP:2000 Cost:8 loot:

Wed, 31 Jan 2:55:17 AM Streak Lightening Lvl:5 Monster:Oliphant Weapon:Flametongue Roll:1 Result:missed Damage:0 HP:42 XP:900 Cost:8 loot:

Wed, 31 Jan 2:55:14 AM Streak Lightening Lvl:5 Monster:Oliphant Weapon:Flametongue Roll:12 Result:killed Damage:11 HP:-4 XP:900 Cost:8 loot:82(Loot) 79(Silver) 33(Item) 20 Two_Handed_Sword

Wed, 31 Jan 2:55:09 AM Streak Lightening Lvl:5 Monster:Oliphant Weapon:Flametongue Roll:19 Result:hit Damage:9 HP:7 XP:900 Cost:8 loot:

Wed, 31 Jan 2:55:03 AM Streak Lightening Lvl:5 Monster:Oliphant Weapon:Flametongue Roll:20 Result:hit Damage:26 HP:16 XP:900 Cost:8 loot:


The navigation() method is showing this kind of links:

1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30

Notice the large number of the current link, you can modify the style with CSS.


The back_forward_link() method, shows only for- and backward links (you can use it for small recordsets):
(this example is using images)