|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2005-02-21 19:34 UTC] sniper@php.net
[2005-03-20 18:00 UTC] sniper@php.net
[2006-04-12 13:17 UTC] garga at FreeBSD dot org
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Oct 27 15:00:01 2025 UTC |
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