[prev in list] [next in list] [prev in thread] [next in thread] 

List:       freetds
Subject:    Re: [freetds] error in connecting using odbc
From:       Peter Harvey <pharvey () codebydesign ! com>
Date:       2003-01-09 3:35:57
[Download RAW message or body]

Which DM are you using?

Peter

Rodel P Hipolito wrote:
> Hi guys,
> 
>  When i tried running the sample connection script below, im getting this
> errors: thanks for your help!
> 
> ===========================================================
> Call to undefined function: odbc_connect() in
> /usr/local/apache/htdocs/ucarbide/test.php on line 16
> ===========================================================
> ===========================================================
> Php Script
> ===========================================================
> <?php
> 
> putenv("LD_LIBRARY_PATH=/usr/local/src/odbcsdk/lib");
> putenv("ODBCINSTINI=/path/to/odbcinst.ini"); //this location will be
> determined by your driver install.
> putenv("ODBCINI=/path/to/odbc.ini"); //odbc.ini contains your DSNs, location
> determined by your driver install.
> $dsn="DSN_NAME"; // this is a valid DSN‚ can be tested in odbctest
> $user="username";
> $password="password";
> 
> $sql="SELECT * FROM table";  //replace “table” with a table name
> if ($conn_id=odbc_connect("$dsn","","")){
> echo "connected to DSN: $dsn";
> if($result=odbc_do($conn_id, $sql)) {
> echo "executing '$sql'";
> echo "Results: ";
> odbc_result_all($result);
> echo "freeing result";
> odbc_free_result($result);
> }else{
> echo "can not execute '$sql' ";
> }
> echo "closing connection $conn_id";
> odbc_close($conn_id);
> }else{
> echo "can not connect to DSN: $dsn ";
> }
> ?>
> 
> _______________________________________________
> FreeTDS mailing list
> FreeTDS@lists.ibiblio.org
> http://lists.ibiblio.org/mailman/listinfo/freetds
> 
> 


_______________________________________________
FreeTDS mailing list
FreeTDS@lists.ibiblio.org
http://lists.ibiblio.org/mailman/listinfo/freetds
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic