SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Zealot
    Join Date
    Apr 2002
    Posts
    136
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    How do I get more accurate results with SELECT MAX(id) WHERE id<=$id?

    I've been doing this and similar queries in order to get the id number right before the one I'm inserting or just to get the latest id number but it seems to only be accurate some of the time. Why is this? How can I compensate for it?

    Also, is it possible to select the max id and then select the name, title or whatever with the max id in the same query? If I did this, would be there be any (faster) way to seperate the two vars other then mysql_fetch_array?

  2. #2
    Sultan of Ping jofa's Avatar
    Join Date
    Mar 2002
    Location
    Svj
    Posts
    4,080
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •