# connect to a DSN "mydb" with a user and password
#DSN is a system wide in this case. user or document wide systems could be possible
$connect = odbc_connect("TEST2", "Administrator", "");
# query the users table for name and surname
$query = "SELECT * FROM Employees";
# perform the query
$result = odbc_exec($connect, $query) or die ("cannot find table");
# fetch the data from the database
while($row = odbc_fetch_array($result)){
$name = $row['LastName'];
$surename = $row['FirstName'];
print("$name $surename
\n");
}
?>
No comments:
Post a Comment