$query = $vbulletin->db->query_read("QUERY HERE"); while($thread = $vbulletin->db->fetch_array($query){ $title = $thread['title']; ..... = ......; }