RE: [PHP] MS SQL server connection problem.
| From: | Andrew Ballard | Date: | Wed, 05 Sep 2012 12:24:20 +0000 |
| Subject: | RE: [PHP] MS SQL server connection problem. | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-319000@lists.php.net to get a copy of this message | ||
On Sep 5, 2012 7:14 AM, "Jeff Burcher" <jeff@allredmetal.com> wrote:
>
> Hi,
>
> I am relatively new as well. I tried both of those methods with no luck. I
> finally had success using odbc_connect(). See below:
>
> $conn = odbc_connect("Driver={SQL
> Server};Server=$server;Database=$database;", $user, $password);
>
> Thanks,
>
> Jeff Burcher - IT Dept
ODBC may work for you, but it has issues if you need to work with text
longer than 4k if I recall.
The SQLSRV library really is the way to go. Just make sure you have the
correct SQL client library installed and use the SQL for PHP driver that
matches your PHP installation. (Threaded, non-threaded, etc.)
Andrew