From: Eric R. (rossiter@discoverynet.com)
Date: 01/22/03


Message-ID: <3E2EC346.4070704@discoverynet.com>
Date: Wed, 22 Jan 2003 10:14:07 -0600
From: "Eric R." <rossiter@discoverynet.com>
Subject: Re: PHP and MYSQL

Advancewarning wrote:
> What is the trick to getting PHP to connect to MYSQL?
>
>
>
> It blows up at this line:
>
> $connection = mysql_connect("$server","$username","$password");
>
>
>
> Giving me this:
>
> *Fatal error*: Call to undefined function: mysql_connect() in
> */web/test.php* on line *15*
>

Well, as it was so elequently explained to me... :)

mysql_connect can't find the database that it's looking for.

Create a test page called info.php:

<?php phpinfo() ?>

Open it in your browser... you should see a block of information about
MySQL... (my guess is, right now, it won't be there)

(If it IS there, have you loaded the default MySQL DB after MySQL
install?? I belive that was a fix for an earlier glitch of this sort.)

If you compiled from source, run ./configure again with the --with-mysql
option.

Depending on your location of MySQL, it would look something like:

./configure --prefix=/usr/local/php
--with-config-file-path=/usr/local/php --with-mysql=/usr/local/mysql
--with-apxs=/usr/sbin/apxs --enable-track-vars --enable-magic-quotes
--enable-debugger

If you're using rpm's, good luck, never got'em to work.

Have a quality day,
E