So you can't use:
while($result=mysql_fetch_array($table)) {
....
}
while($result=mysql_fetch_array($table)) {
....
}
Also, I think you may have the wrong idea about the variables you are working with.
$table in your example would actually be closer to rs in the VBScript:
Set rs = dataconn.execute(sql)
It's actually a result resource and might be more properly labeled $result.
$resultin your example would actually be closer to rows in the VBScript:
rows = rs.GetRows()
Except that all the contents of the recordset are not accesible in this array, thus you use the while loop to create an associate array and use the values in each iteration of your loop.
$table in your example should store the results, so I would theorize you can just run the while loop twice, like above and cycle through twice.