Home > Article > Backend Development > JDBC database Use ODBC to connect to the database under NT IIS
$connection = int odbc_connect(string dsn, string user, string password) to establish a database connection,
$query_string = "Query record conditions"
For example: $query_string = "select * from table"
Use $cur = int odbc_exec(int connection_id, string query_string) retrieve the database and put the record set into the $cur variable.
Reuse while (odbc_fetch_row($cur)){
$var1=odbc_result($cur,1);
$var2=odbc_result($cur,1);
...
}
Read the value returned by odbc_exec() Dataset $cur.
Finally, odbc_close(int connection_id) closes the database connection. The
odbc_result() function takes the specified field value of the current record.
The above introduces the JDBC database using ODBC to connect to the database under NT IIS, including the content of the JDBC database. I hope it will be helpful to friends who are interested in PHP tutorials.