Re: php using odbc
| From: | Vic | Date: | Sat, 27 Jan 2007 02:44:13 +0000 |
| Subject: | Re: php using odbc | ||
| Groups: | php.db | ||
| Request: | Send a blank email to php-db+get-42984@lists.php.net to get a copy of this message | ||
look this as one example of MSAccess connection:
--------
<?
$sDefaultDir = 'C:\apache\htdocs\MDB'; // path dir MDB
$sMDBfile = "cop.mdb"; // MSaccess database name
$sMDBpathAndFilename = $sDefaultDir.'\\'.$sMDBfile; // concatenate
// define dsn
$sCfg_dsn = "DRIVER=Microsoft Access Driver (*.mdb);
DBQ=$sMDBpathAndFilename;
UserCommitSync=Yes;
Threads=3;
SafeTransactions=0;
PageTimeout=5;
MaxScanRows=8;
MaxBufferSize=2048;
DriverId=281;
DefaultDir=$sDefaultDir";
// if you need login and pass
$sCfg_dsn_login = "";
$sCfg_dsn_mdp = "";
$hConn = odbc_connect( $sCfg_dsn, $sCfg_dsn_login, $sCfg_dsn_mdp ) or
die( "Not connection." );
$sql = "select * from table";
$result= odbc_exec($hConn,$sql);
while(odbc_fetch_row($result))
{
$db_field1 = odbc_result($result,"field_name");
}
?>
----------------
check rest of odbc function in php manual.
bye,
you wrote:
> can u help me?
> 1.i wanna build a connection using odbc but i don't have any example.
> what url can i visit?
> 2. odbc i want to connect was on this url.. plz view to help me.
> http://indoupload.net/files/view/803/odbc%20problem.jpg