As I suggested..
Of course, my advice assumes that each related message is stored in id sequence. If it is not, then your application might have to assign a unique sequential id (in addition to the id field I mentioned above) that associates the messages together as a group. Then you can construct an appropriate query to extract just what you need. In other words, it's possible that it is up to your application to handle the organization and relation of the records. -m- -----Original Message----- From: Maria Garcia Suarez [mailto:[EMAIL PROTECTED] Sent: Tuesday, 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)) 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_insert_id($link) function in PHP, or the MySQL > equivalent. Remember > that mysql_insert_id can only be used after an > INSERT and before a COMMIT. > Of course, my advice assumes that each related > message is stored in id > sequence. If it is not, then your application might > have to assign a unique > sequential id (in addition to the id field I > mentioned above) that > associates the messages together as a group. Then > you can construct an > appropriate query to extract just what you need. > I hope this helps. I am certain that you will have > many other offers with > advice for you that may be different than mine. I > am an old database > programmer and so think in those terms often, not > like a SQL designer! The problem is that the ID is auto-incremented for all the messages in the table, not in groups. The first message posted in any forum of the site will have ID=1, the second ID=2 (wherever is it posted) and so on.... Kisses, Maria __________________________________ Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software http://sitebuilder.yahoo.com -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED] -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]