dtwncxs3547 2019-08-09 00:31
浏览 778

SQLSTATE [HY000] [2002] php_network_getaddresses:getaddrinfo failed:没有这样的主机是已知的。 :dataTable使用SQL SERVER 2012的服务器端处理

I was able to implement this tutorial in my test page: https://editor.datatables.net/examples/advanced/joinSelf.

My problem is I cannot implement this example in my other test page? https://datatables.net/examples/data_sources/server_side.html.

What seems to be the problem?

What's the difference between the configuration for dataTable editor and standard dataTable connection via Server-Side?

I am using SQL SERVER 2012, XAMPP, and SQLSRV for connection.

This is what I'm getting.

DataTables warning: table id=example - An error occurred while connecting to the database. The error reported by the server was: SQLSTATE[HY000] [2002] php_network_getaddresses: getaddrinfo failed: No such host is known.

It should work since I only need to populate these lines, right?

// SQL server connection information
$sql_details = array(
    'user' => 'xx',
    'pass' => 'xxxxx',
    'db'   => 'xxxxx',
    'host' => 'xxxxx\SQLSERVER'
);

Similar to what I did to the dataTable Editor, I only populated this line.

/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
 * Database user / pass
 */
$sql_details = array(
    "type" => "Sqlserver",     // Database type: "Mysql", "Postgres", "Sqlserver", "Sqlite" or "Oracle"
    "user" => "xx",          // Database user name
    "pass" => "xxxxx",          // Database password
    "host" => "xxxxx\SQLSERVER", // Database host
    "port" => "",          // Database connection port (can be left empty for default)
    "db"   => "xxxxx",          // Database name
    "dsn"  => "",          // PHP DSN extra information. Set as `charset=utf8mb4` if you are using MySQL
    "pdoAttr" => array()   // PHP PDO attributes array. See the PHP documentation for all options
);

I also have the require( 'ssp.class.php' ); available in server-side scripts since what I downloaded was a full example.

May I ask for your help regarding this matter?

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 sqlite 附加(attach database)加密数据库时,返回26是什么原因呢?
    • ¥88 找成都本地经验丰富懂小程序开发的技术大咖
    • ¥15 如何处理复杂数据表格的除法运算
    • ¥15 如何用stc8h1k08的片子做485数据透传的功能?(关键词-串口)
    • ¥15 有兄弟姐妹会用word插图功能制作类似citespace的图片吗?
    • ¥200 uniapp长期运行卡死问题解决
    • ¥15 请教:如何用postman调用本地虚拟机区块链接上的合约?
    • ¥15 为什么使用javacv转封装rtsp为rtmp时出现如下问题:[h264 @ 000000004faf7500]no frame?
    • ¥15 乘性高斯噪声在深度学习网络中的应用
    • ¥15 关于docker部署flink集成hadoop的yarn,请教个问题 flink启动yarn-session.sh连不上hadoop,这个整了好几天一直不行,求帮忙看一下怎么解决