02.06.2012, 05:24
Your problem is because cache_get_data returns the number of rows of data returned from the SQL query, which will always be one for the query you are performing. The query you are performing will return the highest value of the ID field which you can access with cache_get_row. Kar's solution above should work.