$result = $vbulletin->db->query("query");// and not$query = "query");fetch_array($query); // ;)
$quote_sql = $vbulletin->db->fetch_first("select .....); //fetch first because you got just one result back;)