Subject | Re: php odbc error |
---|---|
Author | googlepost123 |
Post date | 2004-08-04T16:14:41Z |
Just saw the previous post on this topic: "You have to prefix the path
to the database with <server>: in the ODBC source, even for local
connections. For example: 127.0.0.1:c:/blah/blah.fdb"
Fixed my problem.
--- In firebird-support@yahoogroups.com, "googlepost123"
<googlepost123@y...> wrote:
to the database with <server>: in the ODBC source, even for local
connections. For example: 127.0.0.1:c:/blah/blah.fdb"
Fixed my problem.
--- In firebird-support@yahoogroups.com, "googlepost123"
<googlepost123@y...> wrote:
> Hi,
>
> I am using the Employee.fdb sample that comes with Firebird 1.5.1.
> Everything resides on a WinXP Pro pc. I set up an ODBC connection
> called "FB Employee Sample" and tested it with MS Access and Brio;
> works OKAY. When I try to run the following script:
>
> ***************************
> <html>
> <body>
>
> <?php
> $conn=odbc_connect('FB Employee Sample','SYSDBA','masterkey');
> if (!$conn)
> {
> exit("Connection Failed: " . $conn);
> }
> $sql="SELECT * FROM EMPLOYEES";
> $rs=odbc_exec($conn,$sql);
> if (!$rs)
> {
> exit("Error in SQL");
> }
> echo "<table><tr>";
> echo "<th>Employee Name</th>";
> echo "<th>Employee ID</th></tr>";
> while (odbc_fetch_row($rs))
> {
> $empname=odbc_result($rs,"Full Name");
> $empid=odbc_result($rs,"ContactName");
> echo "<tr><td>$empname</td>";
> echo "<td>$empid</td></tr>";
> }
> odbc_close($conn);
> echo "</table>";
> ?>
>
> </body>
> </html>
> ***************************
>
> this is what I get in the browser window: "Warning: odbc_connect()
> [function.odbc-connect]: SQL error: unavailable database, SQL state
> 08004 in SQLConnect in C:\Inetpub\test\odbc-test2.php on line 5
> Connection Failed::. Can someone please tell why this is not working
> in PHP?
>
> TIA