ms sql

Query results into an array only storing one result

I'm successfully connecting to a mssql database and getting results, but I'm trying to place them in an array for display on the page.

The following always gets 1 result and nothing more.
I thought arrays are supposed to store multiple results?

<?php

$conn=odbc_connect('*****','******','*****');
if (!$conn)
{exit("Connection Failed: " . $conn);}

$sql="select Name,Id,Group from members";
$rs=odbc_exec($conn,$sql);
if (!$rs)
{exit("Error in SQL");
echo '';

while (odbc_fetch_row($rs))
{
$id=odbc_result($rs,"Id");

Syndicate content