這是一個簡單的代碼,我用它來獲取來自IB的數據庫中的一些數據:ibase_fetch_assoc在Windows XP上返回錯誤
<?php
$host = 'localhost:C:/ME/DB/test.GDB';
$username='SYSDBA';
$password='*******';
if (!($dbh=ibase_connect($host, $username, $password, 'ISO8859_1', 0, 1)))
die('Could not connect: ' . ibase_errmsg());
$stmt = 'SELECT * FROM DB where CODE >= 4400';
$sth = ibase_query($dbh, $stmt);
$letters = array();
while ($row = ibase_fetch_assoc($sth)) {
echo $row['CODE'] . ' ';
}
ibase_free_result($sth);
ibase_close($dbh);
?>
該代碼工作正常的Windows 7,但在XP(這是其中代碼應工作在生產),它返回以下錯誤:
ibase_fetch_assoc(): arithmetic exception, numeric overflow, or string truncation Cannot transliterate character between character sets
任何人知道如何使它發揮作用?
P.S. 文檔在這裏說http://www.php.net/manual/en/function.ibase-query.php
If you get some error like "arithmetic exception, numeric overflow, or string truncation. Cannot transliterate character between character sets" (this occurs when you try use some character with accents) when using this and after ibase_query() you must set the character set (i.e. ISO8859_1 or your current character set).
這是在我的情況該如何解決?如果是我該如何設置字符集?
'NONE' 的伎倆!謝謝! – 2013-04-30 09:27:31