Or more simply, change your select, and reference the resulting $result array properly:
$sql = "SELECT sites.siteName,
invoice.name,
payments.cost,
payments.dueDate,
payments.status
FROM payments, invoices, siteBin, sites
WHERE payments.invoiceID=invoices.invoiceID
AND invoices.siteID=sites.siteID
AND siteBin.userID=$userID
AND sites.siteID=siteBin.siteID
;";
$query = mysql_query($sql) or die (mysql_error());
while( $result = mysql_fetch_array($query)){
?>
<tr>
<td><?php echo $result['siteName'];?></td>
<td><?php echo $result['name'];?></td>
<td><?php echo $result['cost'];?></td>
<td><?php echo $result['dueDate'];?></td>
<td><?php echo $result['status'];?></td>
<td> </td>
<td> </td>
</tr>