DMXzone Ajax Form Support Product Page

Answered

How to return previous (or next) values in MySQL?

Asked 27 May 2013 08:18:15
1
has this question
27 May 2013 08:18:15 Michele - posted:
I'd like to create a query that allow me to rescue the previous value in a mysql table.

I've a detail news page with a URL parameter filter* and I need to recuperate the previous value in the recordset; for example, if the page view the news with ID 5, a secondary query should view the previous value (ID 4).

How to create this sql code?

Thanks,
Michele


*
"SELECT * FROM tbl_news WHERE url_news = %s AND tbl_news.status_news = 1", GetSQLValueString($colname_rsNewsDetails, "text")

Replies

Replied 28 May 2013 09:36:27
28 May 2013 09:36:27 Miroslav Zografski replied:
Hello Michele,

You can check this article:
stackoverflow.com/questions/1446821/how-to-get-next-previous-record-in-mysql

Regards.
Replied 28 May 2013 09:40:17
28 May 2013 09:40:17 Michele - replied:
Ok, thanks Miro!

Reply to this topic