PHPBuilder - ODBC connection



RSS Twitter
Snippets Databases

ODBC connection

by: Himadrish Laha
|
November 28, 2003

Version: 1.4

Type: Function

Category: Databases

License: GNU General Public License

Description: Used this to make a connection through ODBC, you can connect oracle, sql server, access, mysql using php, vb etc.



<?php
// This function created for making ODBC connection with databses
//	Created on 30th DEcember,2002 by Himadrish Laha himadrish@yahoo.com
$connectionstring = odbc_connect("babu", "tiscocmon", "tiscocmon"); 

$Query = "select * from cybertiming"; 
$queryexe = odbc_do($connectionstring, $Query); 


    while(odbc_fetch_row($queryexe)) 
    { 
     
    $cid = odbc_result($queryexe, "cyberid");
    $upno = odbc_result($queryexe, "userpno");
    echo "  $cid    $upno   \n";
    } 

odbc_close($connectionstring); 

exit();
?>

Comment and Contribute

Your comment has been submitted and is pending approval.

Author:
Himadrish Laha

Comment:



Comment:

(Maximum characters: 1200). You have characters left.