A summary of some problems of parity system

Source: Internet
Author: User
Tags dsn odbc mssql php windows

A brief summary of some of the problems encountered by the parity system recently:

Links to MSSQL and PHP.  "Ntwdblib.dll file version low causes PHP to not connect to MSSQL" Ntwdblib.dll (2000.80.194.0) PHP invokes Java program. [The program running the jar package cannot invoke the jar in its own package, workaround 1: You can set the Class-path property of the MANIFEST.MF file inside the jar pack.) For example: class-path:commons-beanutils.jar,2: Packaging things can be called to unpack the jar pack class with their own program class together with the "PHP or Java Call Network Neighborhood file picture Resolution text OCR




The latest PHP 5.3.6 Php_mssql.dll,php_pdo_mssql.dll are gone.

There is only one php_pdo_odbc.dll.

So~ the newest and best PHP connection MSSQL method should be this:


<?php

Preliminary validation Not available



$CNX = new PDO ("ODBC:DRIVER=TDS; server= $server;D atabase=newaiderdb; ", $user, $passwd);

$DSN = "ODBC:DRIVER=TDS; Server= $server; Uid= $user; Pwd= $passwd; Database=newaiderdb; ";
$CNX = new PDO ($DSN);

Miscrosoft sqlsrv for PHP windows
$CNX = new PDO ("sqlsrv:server= $server; Database = Newaiderdb ", $user, $passwd, Array (pdo::sqlsrv_attr_direct_query => true));
Linux, TDS Data Source, support UTF8
$CNX = new PDO (' Odbc:mssql ', $user, $passwd);
$CNX = new PDO ("Odbc:driver={sql Server}"; server=127.0.0.1;database=test; "," "sa" "," "asd123" ");

Var_dump ($CNX);



$a = $cnx->query ("SELECT * from [user]");

Var_dump ($a);

foreach ($a as $b) {

Var_dump ($b);

}


?>

Ubuntu PHP 5.3.6

Verify that the available

$cnx = new PDO (' dblib : Host=192.168.2.243:1433;dbname=newaiderdb ', $user, $passwd);

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.