get data from ms access table

wxdqz

New Member
I would like to ask how to get data from ms access table? The code bellow success read table field but can't get data from table. What's the error inside this code? Anyone can help me???

<?php
$connect = odbc_connect("access database","Admin"," ");
$result = odbc_exec($connect, "SELECT * FROM employees");

$a = odbc_field_name($result, 1);
$b = odbc_field_name($result, 2);

echo "Field 1: $a<br>";
echo "Field 2: $b<br>";

while(odbc_fetch_into($results, &$row)){
printf("The name is %s\n",$row["name"]);
printf("The position is %s\n",$row["position"]);
}
?>

Field 1: name
Field 2: position

Warning: Supplied argument is not a valid ODBC result resource in \php4\odbc.php on line 11
 
Back
Top