Re: How to get previous and next result

2003-09-11 Thread Sebastian Haag
Maria, Maria Garcia Suarez sagte: > Hi there! > > I'm currently developing a web where we let users > create their own forums. All the messages (wherever > they are posted) are stored in the same mysql table. > > When users read a certain message I would like to > display the previous and next mes

RE: How to get previous and next result

2003-09-09 Thread Dan Greene
nd last record by post_date < {current msg post_date} in same forum > -Original Message- > From: Maria Garcia Suarez [mailto:[EMAIL PROTECTED] > Sent: Tuesday, September 09, 2003 11:53 AM > To: [EMAIL PROTECTED] > Subject: How to get previous and next result > > > Hi

RE: How to get previous and next result

2003-09-09 Thread Maria Garcia Suarez
Hi there! --- Christopher Knight <[EMAIL PROTECTED]> wrote: > next: > select cols from table where id > YOUROLDID and > forums = CURRENT_FORUM order by id limit 1 > previous: > select cols from table where id < YOUROLDID and > forums = CURRENT_FORUM order by id desc limit 1 Thanks for your answer

RE: How to get previous and next result

2003-09-09 Thread Christopher Knight
[EMAIL PROTECTED] Sent: Tuesday, September 09, 2003 10:53 AM To: [EMAIL PROTECTED] Subject: How to get previous and next result Hi there! I'm currently developing a web where we let users create their own forums. All the messages (wherever they are posted) are stored in the same mysql tabl

RE: How to get previous and next result

2003-09-09 Thread Mark Richards
esday, September 09, 2003 12:35 To: Mark Richards; [EMAIL PROTECTED] Subject: RE: How to get previous and next result Hi there! --- Mark Richards <[EMAIL PROTECTED]> wrote: > If you simply have a table with an id field that has > the auto-increment > attribute (field is int(10))

RE: How to get previous and next result

2003-09-09 Thread Maria Garcia Suarez
Hi there! --- Mark Richards <[EMAIL PROTECTED]> wrote: > If you simply have a table with an id field that has > the auto-increment > attribute (field is int(10)) then you can get the > current id and go from > there. To get the current ID of a record you just > created, you can use the > mysql_in

RE: How to get previous and next result

2003-09-09 Thread Mark Richards
terms often, not like a SQL designer! Hugs, Mark Richards -Original Message- From: Maria Garcia Suarez [mailto:[EMAIL PROTECTED] Sent: Tuesday, September 09, 2003 11:53 To: [EMAIL PROTECTED] Subject: How to get previous and next result Hi there! I'm currently developing a web where w

How to get previous and next result

2003-09-09 Thread Maria Garcia Suarez
Hi there! I'm currently developing a web where we let users create their own forums. All the messages (wherever they are posted) are stored in the same mysql table. When users read a certain message I would like to display the previous and next message in that forum. Since all the messages (of t