Quick question.

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • ryany
    Member
    • Nov 2000
    • 95

    Quick question.

    I need to retrieve the biggest number from a mysql database.
    Say I need to retrieve the biggest $catergory_id and display it.

    How would the $sql line be like? 'SELECT * from catagories WHERE ??'

    i tried "SELECT MAX(category_id) from categories"
    That doesnt seem to work. hehe

    Hope you get what i mean .
    Need help quickkk thanks
    Last edited by ryany; Fri 29 Jun '01, 6:00pm.
  • G0D
    Senior Member
    • Feb 2001
    • 103

    #2
    SELECT * FROM catagories order by catergory_id DESC LIMIT 1

    Comment

    • ryany
      Member
      • Nov 2000
      • 95

      #3
      Thank you God!

      Comment

      • G0D
        Senior Member
        • Feb 2001
        • 103

        #4
        no problem my son

        Comment

        widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.
        Working...