这是一个简单的代码,我用它来获取来自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