PHP db2_prepare更新失败

时间:2011-05-18 21:40:58

标签: php sql db2 sql-update

每次执行以下代码时,ZendServers都会记录下面显示的错误。库KIVATEST确实存在,文件ORTXNPF确实存在,我能够对这个文件执行一个select语句就好......


[18-May-2011 21:30:40] PHP警告:db2_prepare()[function.db2-prepare]:声明准备在第38行/www/zendserver/htdocs/dev/Merchandising/ResultSetTesting.php失败

[18-May-2011 21:30:40] PHP警告:db2_execute()期望参数1是资源,第39行/www/zendserver/htdocs/dev/Merchandising/ResultSetTesting.php中给出的布尔值

[18-May-2011 21:30:40] PHP致命错误:/www/zendserver/htdocs/dev/Merchandising/ResultSetTesting.php:40

堆栈跟踪:         #0 {main}           在第40行的/www/zendserver/htdocs/dev/Merchandising/ResultSetTesting.php中引发


    $connection = db2_connect ( "*LOCAL", "", "" );
    if (! $connection) {
        Throw New Exception('Could not connect');
    }

    //Prepare and execute the SQL statement.
    [[LINE 38]]  $stmt = db2_prepare ( $connection, "UPDATE KIVATEST.ORTXNPF SET otbfnm = 'AdamTest' where ottxn# = 216807" );
    if (! db2_execute ( $stmt ) ) {
        Throw New Exception('Could not execute');
    }

1 个答案:

答案 0 :(得分:2)

我不确定为什么提供的错误是如此无用......但问题是用户对该文件具有* USE权限,但不是* ALL ...所以我能够选择但不是更新。