note 32539 added to function.odbc-connect
| From: | eric dot ramirez at iberoonline dot com | Date: | Fri, 30 May 2003 15:44:28 +0000 |
| Subject: | note 32539 added to function.odbc-connect | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-49433@lists.php.net to get a copy of this message | ||
Connecting with SQL in a ODBC source
2 ways, one is if your SQL server is runign in your machine
$ser="LOCALMACHINE"; #the name of the SQL Server
$db="mydatabase"; #the name of the database
$user="myusername"; #a valid username
$pass="my pass"; #a password for the username
# one line
$conn=odbc_connect("Driver={SQL
Server};Server=".$ser.";Database=".$db,$user,$pass);
# one line
the second way is if the SQL Server is runing in other machine but in the same network
$ser="LOCALMACHINE"; #the name of the SQL Server
$db="mydatabase"; #the name of the database
$user="myusername"; #a valid username
$pass="my pass"; #a password for the username
#one line
$conn=odbc_connect("DRIVER=SQL
Server;SERVER=".$ser.";UID=".$user.";PWD=".$pass.";
DATABASE=".$db.";
Address=".$ser.",1433","","");
#one line
----
Manual Page -- http://www.php.net/manual/en/function.odbc-connect.php
Edit Note -- http://master.php.net/manage/user-notes.php?action=edit+32539
Delete Note -- http://master.php.net/manage/user-notes.php?action=delete+32539&report=yes
Reject Note -- http://master.php.net/manage/user-notes.php?action=reject+32539&report=yes