JoyBh 0 Newbie Poster

Hi!
I'm unable to connect to my ODBC data resource from PHP. The code I have written is given below. Secondly, I'm not sure what username and password combination to use in the odbc_connect function when the ODBC data source is MS-Access.

Joy.

$connect = odbc_connect("SerMas", "Joyji", "");

# query the users table for name and surname
$query = "SELECT name, surname FROM users";

# perform the query
$result = odbc_exec($connect, $query);

# fetch the data from the database
while(odbc_fetch_row($result)){
    $name = odbc_result($result, 1);
    $surname = odbc_result($result, 2);
    echo "$name $surname\n"; }

# close the connection
odbc_close($connect);