Re: odbc connect problem
| From: | salamander | Date: | Fri, 09 Aug 2002 23:10:00 +0000 |
| Subject: | Re: odbc connect problem | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-21083@lists.php.net to get a copy of this message | ||
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, chip.wiegand@simrad.com 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 <chip@outputservices.com> 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) ChipOn Fri, 9 Aug 2002 chip.wiegand@simrad.com wrote:boxI am attempting for the first time, to connect from freebsd/mysql/phpso Ito a NT box running MAS200. I am able to connect from another NT workstation with Access and download data,"ItemNumber"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>PartNumber</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"<tr><td>$brand</td><td>$number</td><td>$description</td></tr>$description= odbc_result( $result, 3 ); // get the field"ItemDescription"echo-- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php\n";}echo "</table>"; echo "</body></html>";?> -- Chip Wiegand Computer Services Simrad, Inc www.simradusa.com chip.wiegand@simrad.com "There is no reason anyone would want a computer in their home."--Ken Olson, president, chairman and founder of Digital EquipmentCorporation, 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