Edit report at https://bugs.php.net/bug.php?id=12&edit=1
ID: 12 Comment by: junxing dot lin at yahoo dot com Reported by: walton at nordicdms dot com Summary: odbc_execute() causes application error Status: Closed Type: Bug Package: ODBC related Operating System: WinNT 4.0 PHP Version: 3.0 Latest CVS Block user comment: N Private report: N New Comment: http://www.chishairstraighteners.net chi flat iron http://www.chishairstraighteners.net chi flat irons http://www.chishairstraighteners.net chi hair straightener http://www.chishairstraighteners.net chi hair straighteners Previous Comments: ------------------------------------------------------------------------ [1998-02-04 09:20:02] kara No more crashing with b4, but odbc_cursor() doesn't return a name in this environment. I'm unable to reproduce this behaviour. (Different OS/Drivermanager/Driver) ------------------------------------------------------------------------ [1998-01-26 19:31:30] walton at nordicdms dot com [Reposted with updates for 3.0b4-dev behavior] I've been experimenting with odbc_prepare() and odbc_execute() to try to figure out how to use them, and have succeeded only in generating application errors when calling odbc_execute(). I don't know for sure that I'm using them right, but they should at least complain and exit gracefully, not crash in such an ugly way. Here's my code: $result = odbc_prepare($conn,"{call sp_asp_dmsGetArtist (?)}"); $parm[0] = 303; $result = odbc_execute($result, $parm); If I comment out odbc_execute(), the code completes nicely, but leaving it in causes a crash. According to SQLTrace, the query *is* getting sent to the server, which implies that the crash occurs after the SQLExecute() at line 626 of unified_odbc.c (3.0b3-dev). If I change (?) -> (?, ?) in the first line and insert $parm[1] = 0; after the second line, I get the same results. However, if I change (?) -> (?, ?) and leave $parm[1] unset, PHP still crashes, but the query is never sent to the server. In this case, PHP should catch the mismatch in parameters at line 599 and return immediately, which explains why SQLExecute() isn't called. Unfortunately, that doesn't explain why PHP still crashes. **** Update for 3.0b4-dev **** Using $result = odbc_prepare($conn,"{call sp_asp_dmsGetArtist (?, ?)}"); while leaving out $parm[1] = 0; no longer causes a crash. It now properly returns with: Warning: Not enough parameters (1 should be 2) given In the cases that still cause a crash, the last output from PHP is: <br> <b>Warning:</b> which implies that PHP is dieing inside of php3_error()?! ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=12&edit=1