Connect Firebird localhost DB with php -


i have firebird server , firebird database installed on windows server. port on db 8095. on server have installed php, , need connect on db php, here code tried not success:

<?php  $host = 'localhost:d:\path\to\database.fdb'; $username = 'user'; $password = 'pass'; $dbh = ibase_connect($host, $username, $password); $stmt = 'select * storecards'; $sth = ibase_query($dbh, $stmt); while ($row = ibase_fetch_object($sth)) {     echo $row->code, "\n"; } ibase_free_result($sth); ibase_close($dbh);  ?> 

can me please?

thanks lot

edit :

working code :

$dbh = ibase_pconnect("ipaddr:path-to-db.fdb", "user", "pass") or die('die message');     $q = ibase_query($dbh, "select * storecards");     while ($r = ibase_fetch_object($q)) {         $some_value = $r->code;         echo $some_value;     } 

as long said firebird runs on non standard 8095 port (usually 3050), should specify in ibase_connect. ibase_(p)connect('host/port:path_or_alias', ... check if port accessible, no block firewall rules, etc..

so:

$host = 'localhost/8095:d:\path\to\database.fdb'; 

Comments

Popular posts from this blog

ios - MKAnnotationView layer is not of expected type: MKLayer -

ZeroMQ on Windows, with Qt Creator -

unity3d - Unity SceneManager.LoadScene quits application -