您好我想使用的PHP ODBC和我似乎有一些problems.This是我的代碼:連接到數據庫中warnnings ODBC結果和notjing印刷
<?php
$connect = odbc_connect("digitallibrary", "root", "");
$sql = "SELECT name FROM books";
$result = odbc_exec($connect, $sql);
echo $result;
while (odbc_fetch_row($result)) {
$name = odbc_result($result, "name");
print("$name\n");
}
odbc_close($connect);
?>
我也mysql安裝ODBC連接器,並將此係統DSN: 數據源名稱:數字圖書館 TCP/IP服務器:localhost端口80 用戶:根 數據庫:數字圖書館
當我運行我的代碼,我得到這個警告,但沒有印刷:
Warning: odbc_connect(): SQL error: [Microsoft][ODBC Driver Manager] The specified DSN contains an architecture mismatch between the Driver and Application, SQL state IM014 in SQLConnect in E:\Program Files\xampp\htdocs\DigitalLibrary\index.php on line 9
Warning: odbc_exec() expects parameter 1 to be resource, boolean given in E:\Program Files\xampp\htdocs\DigitalLibrary\index.php on line 11
Warning: odbc_fetch_row() expects parameter 1 to be resource, null given in E:\Program Files\xampp\htdocs\DigitalLibrary\index.php on line 14
Warning: odbc_close() expects parameter 1 to be resource, boolean given in E:\Program Files\xampp\htdocs\DigitalLibrary\index.php on line 18
我做錯了什麼?
更高版本的Windows在控制面板/管理工具中同時擁有64位和32位數據源管理員。 –
64位和32位odbc驅動程序可以同時在同一臺服務器上運行嗎?我們有一個Win Server 2008 R2。 – JCm
如果我將另一個ODBC驅動程序(32位版本來滿足我的32位應用程序)添加到現有64位版本的服務器(某些其他應用程序可能使用64位),會不會有問題?它不會造成其他應用程序的confilict?我擔心如果我安裝一個32位版本,它可能會影響服務器上現有的和正在運行的應用程序 – JCm