PHP uses ODBC to connect to the database, and phpodbc connects to the database. PHP uses ODBC to connect to the database. phpodbc connects to the database. this example describes how PHP uses ODBC to connect to the database. Share it with you for your reference. The specific implementation method is as follows: PHP uses ODBC to connect to the database, and phpodbc connects to the database
This example describes how to connect PHP to a database using ODBC. Share it with you for your reference. The specific implementation method is as follows:
PHP and ODBC: XHTML Example 1
<?php $conn = odbc_connect( "DRIVER={MySQL ODBC 3.51 Driver};Server=localhost;Database=phpodbcdb", "username", "password"); if (!($conn)) { echo "Connection to DB via ODBC failed: "; echo odbc_errormsg ($conn ); echo "
\n"; } $sql = "SELECT 1 as test"; $rs = odbc_exec($conn,$sql); echo "
"; echo "
Test |
"; while (odbc_fetch_row($rs)) { $result = odbc_result($rs,"test"); echo "
$result |
"; } odbc_close($conn); echo "
"; ?>
I hope this article will help you with php programming.
Examples in this article describes how to use ODBC to connect to a database in PHP. Share it with you for your reference. The specific implementation method is as follows :...