|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[1998-02-04 09:20 UTC] kara
[2017-10-05 20:24 UTC] willfitch@php.net
[2024-01-23 07:27 UTC] git@php.net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Nov 01 09:00:01 2025 UTC |
[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()?!