I am attempting for the first time, to connect from freebsd/mysql/php box
to a NT box running MAS200. I am able
to connect from another NT workstation with Access and download data, so I
am trying from FreeBSD now.
When I run the code below I get error:

Fatal error: Call to undefined function: odbc_connect() in
/usr/local/apache/htdocs/odbctest.php on line 7

What am I doing wrong? There's not much info on this topic in the mysql

<body bgcolor="white">
$connect = odbc_connect("localhost", "----", "-----");
 if (!$connect)
   Error_handler( "Error in odbc_connect" , $connect );
$result = odbc_exec($connect, "SELECT ProductLineDescription FROM
IMA_ProductLine, ItemNumber,
ItemDescription FROM IM1_InventoryMasterFile where DefaultWhse = 004");
    if (!$result) {
        Error_handler( "Error in odbc_exec( no cursor returned ) " ,
$connect );
    echo "<table border=1><tr><th>Brand</th><th>Part

    // fetch the succesive result rows
    while( odbc_fetch_row( $result ) ) {
        $brand= odbc_result( $result, 1 ); // get the field
        $number= odbc_result( $result, 2 ); // get the field "ItemNumber"
        $description= odbc_result( $result, 3 ); // get the field

        echo "<tr><td>$brand</td><td>$number</td><td>$description</td></tr>

    echo "</table>";
     echo "</body></html>";

Chip Wiegand
Computer Services
Simrad, Inc

"There is no reason anyone would want a computer in their home."
     --Ken Olson, president, chairman and founder of Digital Equipment
Corporation, 1977
 (They why do I have 9? Somebody help me!)

PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to