Hi There
G K wrote:
Here's my test code:
<?php
$ibc = ibase_connect ("tmp/Test","sysdba","masterkey");
$query = ibase_prepare("SELECT * >FROM mytable");
$result = ibase_execute($query);
$arr = ibase_fetch_row($result);
echo $arr[0];
?>
$arr IS ALWAYS EMPTY. If I do an >ibase_num_fields($result) it returns a 1, >which is correct, since there is only 1 >field in mytable. What am I doing wrong? Or >are the ibase functions in php 4.0.1pl2 not >quite ready for primetime?
I Guess the Problem is, that you have to set the database-parameter in a slightly different way; here's an example of me:
<?php
$host='localhostšUMMY.GDB';
$user='sysdba';
$pass='masterke';
$dbh = ibase_connect ($host,$user,$pass);
$stmt = 'SELECT * FROM TB_REMARKS';
$sth=ibase_query($dbh,$stmt);
print 'Connetion-ID: ' . $dbh;
echo "<BR>";
print 'Statement rt: ' . $sth;
echo "<BR>";
print 'Username: ' . $user;
echo "<BR>";
echo "<BR>";
while ($row = ibase_fetch_object ($sth)) {
print $row->GUID . "\n";
print $row->TEXTFIELD . "\n";
echo "<br>";
}
ibase_close($dbh);
?>
I also had to kid around, ibase_pconnect/ibase_connect claims to connect correctly, but if you don't set the db-target like "machinename:databasename" the ibase_fetch_object/ibase_fetch_row functions seem to return nuthin.