In the following code, $threadid is an array with the contents of a single database row.
Code:
$threadid = $vbulletin->db->query_first("
SELECT threadid
FROM " . TABLE_PREFIX . "thread
WHERE pollid = '".$pollida."'
");
So to use the threadid in the next query, you will need to use $threadid['threadid']:
Code:
$checkpost = $vbulletin->db->query_read("
SELECT username
FROM " . TABLE_PREFIX . "post
WHERE threadid = ".$threadid['threadid']."