salamander <[EMAIL PROTECTED]> wrote on 08/09/2002 04:31:35 PM:
> Chip, > I wonder if you set the ODBCINI environment variable with the putenv()? Yep, they are there and I am getting this error when attempting to load the web page - Warning: SQL error: [iODBC][Driver Manager]Specified driver could not be loaded, SQL state IM003 in SQLConnect in /usr/local/apache/htdocs/odbctest.php on line 16 Warning: odbc_exec(): supplied argument is not a valid ODBC-Link resource in /usr/local/apache/htdocs/odbctest.php on line 19 Warning: odbc_fetch_row(): supplied argument is not a valid ODBC result resource in /usr/local/apache/htdocs/odbctest.php on line 22 > If you could show the code in your odbctest.php file that would be > helpful. The output from /usr/local/bin/iodbc-odbctest [iodbc][driver manager]dialog failed, SQLSTATE=IM003 > Andrew Hill Below is the code of the odbctest.php file I am trying to use: <? putenv("LD_LIBRARY_PATH=/usr/local/src/odbcsdk/lib"); putenv("ODBCINSTINI=/usr/local/lib/iodbc/odbcinst.ini"); putenv("ODBCINI=/usr/local/etc/libiodbc/odbc.ini"); $dsn="SOTAMAS90"; $user="---"; $password="----"; ?> <html><head><title>Untitled</title></head><body bgcolor="white"> <? $connect = odbc_connect($dsn, $user, $password); 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 " , $connect ); } echo "<table border=1><tr><th>Brand</th><th> Part Number</th><th>Description</th></tr>\n"; // fetch the succesive result rows while( odbc_fetch_row( $result ) ) { $brand= odbc_result( $result, 1 ); // get the field "ProductLineDescription" $number= odbc_result( $result, 2 ); // get the field "ItemNumber" $description= odbc_result( $result, 3 ); // get the field "ItemDescription" echo "<tr><td>$brand</td><td>$number</td><td>$description</td></tr> \n"; } echo "</table>"; echo "</body></html>"; ?> -- Chip > On Friday, August 9, 2002, at 07:31 PM, [EMAIL PROTECTED] wrote: > > > > Thanks, that fixed that part of it, now here's the newest error message: > > > > > > Warning: SQL error: [iODBC][Driver Manager]Specified driver could not be > > loaded, SQL > > state IM003 in SQLConnect in /usr/local/apache/htdocs/odbctest.php on > > line > > 7 > > > > Fatal error: Call to undefined function: error_handler() in > > /usr/local/apache/htdocs/odbctest.php > > on line 10 > > > > I'm outa here, catch up with ya on monday, > > > > -- > > Chip > > > > salamander <[EMAIL PROTECTED]> wrote on 08/09/2002 04:10:00 PM: > > > >> Chip, > > > >> You are going to have to rebuild the dso with the options you specified > >> before - try cutting and pasting the configure that shows up in your > >> phpinfo() to make it easier. > > > >> Also, you can get the necessary iODBC header files at www.iodbc.org, as > >> well as find a HOWTO there for compiling PHP/iODBC on *nix systems. > > > >> Cheers, > >> Andrew > > > >> On Friday, August 9, 2002, at 06:08 PM, [EMAIL PROTECTED] wrote: > > > >>> Yeah, you're right, I see I need to add --with-iodbc. Now another > >>> question > >>> - when I recompile to add > >>> this support, do I have to add all the other options that I originally > >>> had > >>> listed? Or can I add just this one > >>> and everything else will be left the same? What about php.ini? Will it > >>> be > >>> changed? > >>> > >>> -- > >>> Chip W > >>> > >>> Chip Atkinson <[EMAIL PROTECTED]> wrote on 08/09/2002 02:51:10 > > PM: > >>> > >>>> It looks like you didn't build php with odbc support. > >>>> Try putting in a call to > >>>> phpinfo (); > >>>> and see if it says that odbc support is compiled in. > >>> > >>>> (Another) Chip > >>> > >>>> On Fri, 9 Aug 2002 [EMAIL PROTECTED] wrote: > >>> > >>>>> 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 > >>>>> manual. > >>>>> > >>>>> <html> > >>>>> <head> > >>>>> <title>Untitled</title> > >>>>> </head> > >>>>> <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 > >>>>> Number</th><th>Description</th></tr>\n"; > >>>>> > >>>>> // fetch the succesive result rows > >>>>> while( odbc_fetch_row( $result ) ) { > >>>>> $brand= odbc_result( $result, 1 ); // get the field > >>>>> "ProductLineDescription" > >>>>> $number= odbc_result( $result, 2 ); // get the field > >>> "ItemNumber" > >>>>> $description= odbc_result( $result, 3 ); // get the field > >>>>> "ItemDescription" > >>>>> > >>>>> > >>>>> echo > >>> "<tr><td>$brand</td><td>$number</td><td>$description</td></tr> > >>>>> \n"; > >>>>> } > >>>>> > >>>>> echo "</table>"; > >>>>> echo "</body></html>"; > >>>>> ?> > >>>>> > >>>>> -- > >>>>> Chip Wiegand > >>>>> Computer Services > >>>>> Simrad, Inc > >>>>> www.simradusa.com > >>>>> [EMAIL PROTECTED] > >>>>> > >>>>> "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 > >>>>> > >>>>> > >>> > >>> > >>> -- > >>> PHP Database Mailing List (http://www.php.net/) > >>> To unsubscribe, visit: http://www.php.net/unsub.php > >>> > >>> > > > >> > >> -- > >> PHP Database Mailing List (http://www.php.net/) > >> To unsubscribe, visit: http://www.php.net/unsub.php > > > > > > -- > > PHP Database Mailing List (http://www.php.net/) > > To unsubscribe, visit: http://www.php.net/unsub.php > > > > > > -- > PHP Database Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php