Results 1 to 3 of 3
  1. #1
    Join Date
    Oct 2003
    Location
    London
    Posts
    341

    Question Unanswered: ??? Call to undefined function: odbc_connect()

    Hey guys,

    I was so proud of myself for creating a whole new site in ASPX... only to find that the servers I'm using don't support it (doh!), so instead I'm going to re-write my pages in PHP. I'm currently using a test database called TESTING, with a table TEST, and Fields TEST1, and TEST2.

    All I'm trying to do at the moment is get around how to connect to the database and retrieve a field but I'm getting this error message:

    Call to undefined function: odbc_connect()
    in /home/c21tran/public_html/TESTING.php on line 88

    However, I can't find anything wrong with the code. Can someone take a look and see what I've done wrong?


    <table>
    <?php
    $conn=odbc_connect('testing','admin','1234');
    $sql="SELECT * FROM test";
    $rs=odbc_exec($conn,$sql);

    if (!$rs)
    {exit("Error in SQL");}
    echo "<tr>";
    echo "<td width='300'>";
    echo "<th>Test1</th></td>";
    echo "<td width='300'>";
    echo "<th>Test2</th></td>";
    echo "</tr>";
    while (odbc_fetch_row($rs))
    {
    $Test1=odbc_result($rs,"Test1");
    $Test2=odbc_result($rs,"Test2");
    echo "<tr><td>$Test1</td>";
    echo "<td>$Test2</td></tr>";
    }
    odbc_close($conn);
    ?>
    </table>


    Thank you in advance.

  2. #2
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    so which library uses odbc_connect, and is support for that library built in to the version of PHP you are using
    which db are you using

  3. #3
    Join Date
    Oct 2003
    Location
    London
    Posts
    341
    honestly... I have absolutely no idea what you are talking about.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •