PHP & mySQL

Jamey Osborne yellowdog-general@lists.terrasoftsolutions.com
Sun Jun 23 09:14:01 2002


At 12:40 AM 6/23/2002 -0400, you wrote:
>Your quick response is appreciated! I tried other forums, and noone had a 
>remote clue...(not that I did either..but you know..)
>
>I added those lines to php.ini & restarted httpd, and I still get the error:
>
>Call to undefined function: mysql_connect()
>
>Is there something I missed?

Well, just taking a weak stab in the dark.  Without my manuals in front of 
me, either...

As I recall, don't you have to specify the database to be used in the 
mysql_connect?  I didn't see that in your $Link line.  You're calling the 
DB before you've specified it......

?

Jamey Osborne


>Thanks in advance..
>
>-Z
>
>mysql_connect
>Blake Skinner <malice@mac.com> wrote:
>
> >The default install of PHP included with YDL does not function properly
> >when MySQL or Postgresql calls are made to it. All the problems lie in
> >the php.ini file so open this file in your favorite editor and search
> >for "extension_dir".
> >Change the line to:
> >    extension_dir = /usr/lib/php4
> >
> >Next, search for extension until you come to the following section:
> >    ;;;;;;;;;;;;;;;;;;;;;;
> >    ; Dynamic Extensions ;
> >    ;;;;;;;;;;;;;;;;;;;;;;
> >    ;
> >
> >insert the following:
> >
> >    ; Unix Extensions
> >    extension=imap.so
> >    extension=ldap.so
> >    extension=odbc.so
> >    extension=pgsql.so
> >    extension=mysql.so
> >
> >Finally, restart httpd (service httpd restart)
> >
> >On Saturday, June 22, 2002, at 06:34  PM, Zack wrote:
> >
> >> I get an odd error message in when I attempt to use mysql_connect in a
> >> php script:
> >>
> >> Fatal error: Call to undefined function: mysql_connect() in
> >> /home/sherlock/public_html/newsite/blah2.php on line 16
> >>
> >> Here is my php code, which has worked on other servers before:
> >>
> >> <?php
> >> // Set the variables for the database access:
> >> $Host = "localhost";
> >> $User = "root";
> >> $Password = "<not displayed";
> >> $DBName = "sherlock";
> >> $TableName = "property";
> >>
> >> $Link = mysql_connect ($Host, $User, $Password) or die( mysql_error() );
> >> $Query = "SELECT * from $TableName";
> >> $Result = mysql_db_query ($DBName, $Query, $Link) or die
> >> ( mysql_error() );
> >> ?>
> >>
> >>
> >> To install Apache, mySQL, & PHP, I used "apt-get install apache mysql
> >> php" which downloaded and installed the appropriate packages.
> >>
> >> I have enabled mysql support in both php.ini and httpd.conf.
> >>
> >> All other PHP functions, including writing to a text file, seem to
> >> function just fine.
> >>
> >> I have even reinstalled Apache, mySQL & PHP.
> >>
> >> Anyone have any idea why mysql_connect AND mysql_pconnect would return
> >> as an undefined function? Its as if PHP has no idea what a mysql
> >> database is, even though it has built in support for it.
> >>
> >> Any help is greatly appreciated, and I thank you in advance.
> >>
> >> And yes, this is running on Yellow Dog Linux 2.2
> >>
> >> Thanks,
> >>
> >> -Z