RE: [PHP] << Previous / Next Buttons >>
| From: | Michael O'Neal | Date: | Mon, 10 Sep 2001 15:21:37 +0000 |
| Subject: | RE: [PHP] << Previous / Next Buttons >> | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-66765@lists.php.net to get a copy of this message | ||
on 9/6/01 11:52 PM, php-general-digest-help@lists.php.net went and wrote:
> I'll show you what I did but realize I'm an advanced beginner/intermediate
> programmer. This may not be the most efficient way to do it but seems to
> be the simplest code compared to other ways of doing it that I've seen. Not
> sure if I will explain this well enough either. And this is for a fairly small
> database. With a larger one it may be too inefficient.
>
> First count how many records are in the database for the album and put
> it in $count.
>
> Then loop through all the records in the album, place the id for each record
> in an array and find out where in the array the current record is. $photo_id
> is fed to this script which tells it which picture to display:
>
> $x = 0;
> while ($row = mysql_fetch_array($result)) {
> $photo_id1 = $row['photoid'];
> $array[$x] = $photo_id1;
> if ($photo_id1 == $photo_id) {
> $position = $x;
Thanks a lot, Jeff & Chris. I'll try it this morning!
mto
--
Michael O'Neal
Web Producer/ Autocrosser
ST 28 '89 Civic Si
---------------------
M A N G O
B O U L D E R
---------------------
http://www.thinkmango.com
e- mike@thinkmango.com
p- 303.442.1821
f- 303.938.8507