If you just want that code to work with 3.5, use this:
Code:
$newestthreadidq = $db->query_read("
SELECT threadid
FROM thread
ORDER BY threadid DESC
LIMIT 1
");
$newestthreadid = $db->fetch_array($newestthreadidq);
$newestpostidq = $db->query_read("
SELECT postid
FROM post
ORDER BY postid DESC
LIMIT 1
");
$newestpostid = $db->fetch_array($newestpostidq);
$formattedthreadid = number_format($newestthreadid[threadid]);
$formattedpostid = number_format($newestpostid[postid]);