[PHP-DB] Interbase Prepared Query! From: Daniel Ems (dems <email protected>)
Date: 10/12/01

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.

-- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-db-unsubscribe <email protected> For additional commands, e-mail: php-db-help <email protected> To contact the list administrators, e-mail: php-list-admin <email protected>