> > We have a DB of customer comments that we want to display one at a time
on
> > our web site.  We want the web pages (wrote in php) to use a user
> > name/password on the DB that has SELECT ability and that's it.
> >
> > What's the best way to cycle through the comments so that each page
> > requested gets the "next" comment to be displayed without writing the
> > "current" display number back to the database?  Of course I could store
it
> > in a file or something, but I was hoping for a clean mysql solution.
Like
> a
> > LAST_INSERT_ID( ), only I'm looking for a LAST_SELECTED_ID( ) and then
I'd
> > select the next ID available.

You could do something like this:

$start = 0;
if (isset($_GET['start'])) {
    $start = 1 * $_GET['start']; //make sure it's numerical
}

then query:
    SELECT ...... FROM ...... ORDER BY date LIMIT $tart, 1

display the comment

$start++;

provide a link to thispage.php?start=$start

Regards, Jigal.



-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to