Re: Call to undefined function: odbc_connect()
| From: | Keith Roberts | Date: | Wed, 07 Aug 2002 20:25:15 +0000 |
| Subject: | Re: Call to undefined function: odbc_connect() | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-111579@lists.php.net to get a copy of this message | ||
Sorry about the double post. Here is the info from phpinfo();
System Linux rev66.dhcp 2.2.16C28_III #1 Mon Jul 30 22:07:58 PDT 2001
i586 unknown
Build Date Mar 31 2002
Configure Command './configure' '--prefix=/usr'
'--with-apxs=/usr/sbin/apxs' '--with-gd' '--with-gettext=/usr'
'--enable-safe-mode' '--with-config-file-path=/etc/httpd'
'--with-exec-dir=/usr/bin' '--with-zlib' '--enable-magic-quotes'
'--with-regex=system' '--with-ttf' '--with-db' '--with-gdbm'
'--enable-mbstring' '--enable-mbstr-enc-trans' '--enable-track-vars'
'--enable-wddx=shared' '--enable-mm=shared' '--enable-xml'
'--enable-ftp'
'--disable-debug' '--with-libdir=/usr/lib' '--with-db3'
'--with-interbase=shared' '--with-pgsql=shared' '--with-ldap'
'--with-imap'
'--with-curl=shared' '--with-pdflib=shared'
So I just add --with-odbc to the above configure commands? I assume that it
does not matter where it is up there, simpley what it is there? I noticed
that the command, --with-mysql, is not present, but I am able to use the
mysql functions without any problems. Does this mean that there may be
additional configure commands that I need?
--
Keith Roberts
IT Manager
Laptops For Less
2995 White Star
Anaheim, CA 92806
(714) 224 - 3980
http://www.laptopsforless.com
----- Original Message -----
From: "Joseph Tate" <jtate@mi-corporation.com>
To: "Keith Roberts" <keith@getadeal.com>
Sent: Wednesday, August 07, 2002 1:10 PM
Subject: RE: [PHP-DEV] Call to undefined function: odbc_connect()
> It happens a lot.
>
> If you installed php from the RPM, just install the php-odbc RPM from the
> CD, or from your favorite Red Hat ftp site. It should work then. If not,
> (why not?) download the source from php.net and follow the directions in
the
> README.UNIX-BUILD-SYSTEM. Or in the documentation at
> http://www.php.net.
>
>
> Before you go about recompiling PHP however, write a simple script:
>
> <?PHP
> echo phpinfo();
> ?>
>
> Call it up in your favorite web browser, and see what modules you really
do
> have avaliable.
>
> > -----Original Message-----
> > From: Keith Roberts [mailto:keith@getadeal.com]
> > Sent: Wednesday, August 07, 2002 3:56 PM
> > To: Joseph Tate
> > Subject: Re: [PHP-DEV] Call to undefined function: odbc_connect()
> >
> >
> > Sorry about the incorrect posting. I thought dev was for developers in
> > general, not the developers of php. It appears that the only thing
> > commented out in the php.ini file is the default user, db, and password.
> > How do I recompile php to include odbc? I am using a Cobalt
> > Server, Red Hat
> > Linux, and I am relatively new to the world of Linux/php/etc.
> >
> > I do appreciate your help.
> > --
> > Keith Roberts
> > IT Manager
> > Laptops For Less
> > 2995 White Star
> > Anaheim, CA 92806
> > (714) 224 - 3980
> > http://www.laptopsforless.com
> > ----- Original Message -----
> > From: "Joseph Tate" <jtate@mi-corporation.com>
> > To: "Dan Kalowsky" <dank@deadmime.org>; "Keith Roberts"
> > <keith@getadeal.com>
> > Cc: <php-dev@lists.php.net>
> > Sent: Wednesday, August 07, 2002 12:36 PM
> > Subject: RE: [PHP-DEV] Call to undefined function: odbc_connect()
> >
> >
> > > If you're using the shared module, make sure that you have the
> > odbc module
> > > uncommented in the module list in your php.ini file. If not, make
sure
> > > you've compiled PHP with --with-odbc in the configure statement.
> > >
> > > But this question belongs on the php-general list.
> > >
> > > Joseph
> > >
> > >
> > > > -----Original Message-----
> > > > From: Dan Kalowsky [mailto:dank@deadmime.org]
> > > > Sent: Wednesday, August 07, 2002 3:23 PM
> > > > To: Keith Roberts
> > > > Cc: php-dev@lists.php.net
> > > > Subject: Re: [PHP-DEV] Call to undefined function: odbc_connect()
> > > >
> > > >
> > > > A) Not enough info to even begin to help debug this
> > > > B) Wrong list, you want the php-general list not php-dev list.
> > > >
> > > > On Wed, 7 Aug 2002, Keith Roberts wrote:
> > > >
> > > > > I am getting this error when trying to connect to a MS Access
> > > > database. I
> > > > > do think that it is the connection that is failing, it is the
> > function:
> > > > >
> > > > > Fatal error: Call to undefined function: odbc_connect() in
> > > > > /home/sites/home/web/phptest.htm on line 37
> > > > >
> > > > > What am I doing wrong or what have I missed. Here is a snippet
> > > > of the code
> > > > > that I am using:
> > > > >
> > > > > function Output_Entries() {
> > > > > /*
> > > > > Make the connection to the database. The syntax is
> > > > > odbc_connect( 'SYSTEM_DSN' , 'USER',
> > > > > 'PASSWORD' );
> > > > > $cnx will hold the
> > > > > pconnect is used to establish a persistent database
> > > > > connection to the Database until the procedure is
completed.
> > > > > */
> > > > >
> > > > > $cnx = odbc_connect( 'SLSocket' , '', ''
> > > > > );
> > > > > if (!$cnx) {
> > > > > Error_handler( "Error in odbc_connect" , $cnx );
> > > > > }
> > > > >
> > > > > // send a simple odbc query . returns an odbc cursor
> > > > > $cur= odbc_exec( $cnx, "select
> > > > > Index,ItemNumber,ItemDescription,ProductLine from People" );
> > > > > if (!$cur) {
> > > > > Error_handler( "Error in odbc_exec( no cursor returned
> > > > ) " , $cnx );
> > > > > }
> > > > > echo "<table
> > > > > border=1><tr><th>Index</th><th>First Name</th>".
> > > > > "<th>Last Name</th><th>Phone
> > > > > Number</th></tr>\n";
> > > > > $nbrow=0; //Local variable to count number of rows
> > > > >
> > > > > // fetch the succesive result rows
> > > > > while( odbc_fetch_row( $cur ) ) {
> > > > > $nbrow++;
> > > > > $Index= odbc_result( $cur, 1 ); // get the field "Index"
> > > > > $ItemNumber= odbc_result( $cur, 2 ); // get the field
> > > > "ItemNumber"
> > > > > $ItemDescription= odbc_result( $cur, 3 ); // get the field
> > > > > "ItemDescription"
> > > > > $ProductLine= odbc_result( $cur, 4 ); // get the field
> > > > "ProductLine"
> > > > >
> > > > > echo
> > > > > "<tr><td>$Index</td><td>$ItemNumber</td>".
> > > > >
"<td>$ItemDescription</td><td>$ProductLine</td></tr>\n";
> > > > > }
> > > > >
> > > > > echo "<tr><td colspan=2>$nbrow entries
> > > > > </td></tr></table>";
> > > > >
> > > > > // close the connection. important if persistent connection
are
> > "On"
> > > > > odbc_close( $cnx);
> > > > > }
> > > > >
> > > > > function Error_Handler( $msg, $cnx ) {
> > > > > echo "$msg \n";
> > > > > odbc_close( $cnx);
> > > > > exit();
> > > > > }
> > > > >
> > > > >
> > > > > --
> > > > > --
> > > > > Keith Roberts
> > > > > IT Manager
> > > > > Laptops For Less
> > > > > 2995 White Star
> > > > > Anaheim, CA 92806
> > > > > (714) 224 - 3980
> > > > > http://www.laptopsforless.com
> > > > >
> > > > >
> > > > >
> > > > >
> > > >
> > > > >---------------------------------------------------------------<
> > > > Dan Kalowsky "A little less conversation,
> > > > http://www.deadmime.org/~dank a little more
> > > > action."
> > > > dank-nos@mpa-deadmime.org - "A Little Less Conversation",
> > > > kalowsky@php.net Elvis Presley
> > > >
> > > >
> > > > --
> > > > PHP Development Mailing List
> > > > <http://www.php.net/>
> > > > To unsubscribe, visit:
> > > > http://www.php.net/unsub.php
> > >
> > >
> >
>
>