I have a simple code for selecting data using MySQl and PHP. Here it is:
<?php
require_once 'login.php' ;
$db_server = mysql_connect($db_hostname, $db_username, $db_password);
if (!$db_server) die ("Unable to connect to MySQL: " . mysql_error());
mysql_select_db($db_database)
or die("Unable to choose DB: " . mysql_error());
$query = "SELECT * FROM bank";
$result = mysql_query($query);
if (!$result) die ("Failed with connection to DB: " . mysql_error());
$rows = mysql_num_rows($result);
for ($j=0; $j < $rows; ++$j) {
$row = mysql_fetch_row($result);
echo 'MFO: ' . $row[0] . '<br/>';
echo 'NAME: ' . $row[1] . '<br/>';
echo 'STATE: ' . $row[2] . '<br/><br/>';
}
?>
But i have to use ODBC driver instead of standard integrated driver. I've read a lot of information but haven't find anything , so maybe someone help what should i add or rewrite in this code for using ODBC ?