From:             steven dot harrison3 at ntlworld dot com
Operating system: windows 2000 pro
PHP version:      4.3.9
PHP Bug Type:     InterBase related
Bug description:  ibase_query(): message length error

Description:
------------
I use a number of if statements to select an SQL string (in this case to
execute a stored procedure in a firebird database)to go in a $query
variable.
 When the string is created and ran as a query the following is kicked out
onto the screen:
ibase_query(): message length error(encountered 0, expected 7346) in ....

a typical sql string generated may be:
EXECUTE PROCEDURE SEARCH_ALL_PARAM('Teesside','business
planning','Middlesbrough','the'); 

The parameters are taken from 4 fields on a search web page. 

Reproduce code:
---------------
//Stored procedures used:
//SEARCH_NO_PARAM  - where all the search boxes have 'any' and keyword ''
if ($provider == "any" && $level == "any" && $location == "any" &&
$keyword == "")
{
$query = "EXECUTE PROCEDURE SEARCH_NO_PARAM;";
}
//SEARCH_ALL_PARAM - where all the search boxes have information.
if ($provider != "any" && $level != "any" && $location != "any" &&
$keyword != "")
{
$query = "EXECUTE PROCEDURE
SEARCH_ALL_PARAM('".$provider."','".$level."','".$location."','".$keyword."');";

}
// ### some $query removed to keep things brief. ###
?>
      <div align="center"><font size="+1"><strong>Queries and Reports
about the
        courses :</strong> </font> </div>
      <p align="center">

        <input name="submit" type="submit" value="back and change
search">
        <input name="button2" type="button"
onClick="window.location.replace('Query.php')" value="new search">
        <input name="button2" type="button"
onClick="window.location.replace('information_syllabus.php')" value="main
menu">
      </p>
      </form>
      <div align="center">
        <table width="100%" border="1">
          <tr bgcolor="#e0ffe0">
            <td>Course Title</td>
            <td bgcolor="#e0ffe0">Location</td>
            <td>Entry requirements</td>
          </tr>
          <?

                                        $result = ibase_query($db, $query);
                                                while ($row = 
ibase_fetch_object($result)) {?>
          <tr bgcolor="#f0fffe">
            <td><a href="coursedetail.php?courseid=<? echo
$row->ENTRYID;?>"><? echo $row->COURSETITLE;?></a></td>
            <td bgcolor="#f0fffe">
              <?
                                                if ($location=="any"){
                                                        $query2 = "SELECT * 
FROM TBL_MODULE_DELIVERY Where
ENTRYID='".$row->ENTRYID."'";
                                                } else {
                                                        $query2 = "SELECT * 
FROM TBL_MODULE_DELIVERY Where
ENTRYID='".$row->ENTRYID."' AND DELIVERYTOWN='".$location."'";
                                        }
                                                echo "University provider : ";
                                                if (isset 
($row->PROVIDERINSTITUTION) &&
$row->PROVIDERINSTITUTION!="") {echo $row->PROVIDERINSTITUTION;}else{ echo
" - ";}
                                                echo "<BR> Delivery Town of 
Location(s): ";
                                                $result2 = ibase_query($db, 
$query2);
                                                while ($row2 = 
ibase_fetch_object($result2)) {
                                                        if (isset 
($row2->DELIVERYTOWN) && $row2->DELIVERYTOWN!=""){
                                                                echo 
$row2->DELIVERYTOWN." - ";
                                                        } else {
                                                                echo " - ";
                                                        }
                                                } ?>

Expected result:
----------------
return a result set from a search of courses in a firebird database.

Actual result:
--------------
$query echoed to screen to see if search string right:
EXECUTE PROCEDURE SEARCH_ALL_PARAM('Teesside','business
planning','Middlesbrough','the');

Then the warning message:
Warning: ibase_query(): message length error (encountered 0, expected
7346) in c:\program files\apache
group\apache\htdocs\e_prospectus\results.php on line 252

Warning: ibase_fetch_object(): supplied argument is not a valid InterBase
result resource in c:\program files\apache
group\apache\htdocs\e_prospectus\results.php on line 253


-- 
Edit bug report at http://bugs.php.net/?id=32053&edit=1
-- 
Try a CVS snapshot (php4):   http://bugs.php.net/fix.php?id=32053&r=trysnapshot4
Try a CVS snapshot (php5.0): 
http://bugs.php.net/fix.php?id=32053&r=trysnapshot50
Try a CVS snapshot (php5.1): 
http://bugs.php.net/fix.php?id=32053&r=trysnapshot51
Fixed in CVS:                http://bugs.php.net/fix.php?id=32053&r=fixedcvs
Fixed in release:            http://bugs.php.net/fix.php?id=32053&r=alreadyfixed
Need backtrace:              http://bugs.php.net/fix.php?id=32053&r=needtrace
Need Reproduce Script:       http://bugs.php.net/fix.php?id=32053&r=needscript
Try newer version:           http://bugs.php.net/fix.php?id=32053&r=oldversion
Not developer issue:         http://bugs.php.net/fix.php?id=32053&r=support
Expected behavior:           http://bugs.php.net/fix.php?id=32053&r=notwrong
Not enough info:             
http://bugs.php.net/fix.php?id=32053&r=notenoughinfo
Submitted twice:             
http://bugs.php.net/fix.php?id=32053&r=submittedtwice
register_globals:            http://bugs.php.net/fix.php?id=32053&r=globals
PHP 3 support discontinued:  http://bugs.php.net/fix.php?id=32053&r=php3
Daylight Savings:            http://bugs.php.net/fix.php?id=32053&r=dst
IIS Stability:               http://bugs.php.net/fix.php?id=32053&r=isapi
Install GNU Sed:             http://bugs.php.net/fix.php?id=32053&r=gnused
Floating point limitations:  http://bugs.php.net/fix.php?id=32053&r=float
No Zend Extensions:          http://bugs.php.net/fix.php?id=32053&r=nozend
MySQL Configuration Error:   http://bugs.php.net/fix.php?id=32053&r=mysqlcfg

Reply via email to