Interbase Prepared Query!
| From: | Daniel Ems | Date: | Fri, 12 Oct 2001 14:56:07 +0000 |
| Subject: | Interbase Prepared Query! | ||
| Groups: | php.db | ||
| Request: | Send a blank email to php-db+get-13294@lists.php.net to get a copy of this message | ||
Does anyone have an example of a WORKING interbase prepared query?
I cannot get the following code to work - I get the error that "The
document contained no data";
<begin>
$dbh = ibase_connect ( $host, $username, $password ) ;
$stmt = 'SELECT "STATENAME" FROM "STATES" WHERE "STATEABBR" = ?
' ;
$prep = ibase_prepare ( $dbh, $stmt ) ;
$states = array( "IN", "KY", "DE", "WA" );
foreach ( $states as $abbr ) {
$result = ibase_execute ( $prep, $abbr ) ;
while($row = ibase_fetch_row($result)) {
echo $row[0]."<br>";
}
ibase_free_result($result);
}
<end>
Here's the weird part: If I change the column name to an invalid name
(i.e. TATENAME vs. STATENAME) The page loads but with the error message
that "TATENAME" is an unknown column!
The sql works through the command line (as plain sql, not a prepared
query). Any ideas
Thanks
--
Daniel Ems
AM/FM/GIS Technical Support
Spatial Data Integrations, Inc.