Fatal error: Call to undefined function mysql_connect() in c:/Inetpub/wwwroot/mysqlconnect.phpon lin

Fatal error: Call to undefined function mysql_connect() in c:/Inetpub/wwwroot/mysqlconnect.phpon lin

am 25.08.2005 20:31:04 von Tony_Aldemir

Hello There,

I am getting the "Fatal error: Call to undefined function mysql_connect()
in c:\Inetpub\wwwroot\mysqlconnect.php on line 2" error when I try to
connect to the MySQL DB using:
$conn = mysql_connect("localhost", "joeuser", "somepass");
echo $conn;
?>

I have made sure that my PHP.INI file is adjusted to reflect the following:

Uncommented the line "extension=php_mysql.dll" exposing this DLL to PHP.
I added the following line
extension_dir = "c:\php\ext"

I copied the libmySQL.dll to the c:\inetpub\wwwroot folder (I am using the
IIS on this machine, but I have the same configuration using the latest
APACHE Server on my home machine and when It try the same code on that
machine, I get no response showing me the value of the $conn, but I do not
get any error message either). Confusing situation!

I do have the php_mysql.dll in the C:\php\ext folder

Well, none of this seem to matter. I am still getting the error listed
above using IIS .

Here is my setup:
I have MySQL 4.1.13a-nt installed. I am able to run MySQL Admin to add
users, add tables to the TEST DB, add records to the new table via the
command line as well as via the MySQL Query Browser. So I am pretty sure
that my MySQL is installed and working fine.)

I have the MySQL program installed on the default location "C:\Program
Files\MySQL\MySQL Server 4.1" as oppose to changing it to c:\MySQL folder
during the installation. I am hoping that this is not the reason for this
problem, but I am not sure.

I am able to run other non-MySQL related simple PHP code via my browser
just fine.
(Example:

Hello World

'; ?>
and a few other simlar stuff. That all works fine.

But when I use the
$conn = mysql_connect("localhost", "joeuser", "somepass");
echo $conn;
?>
code it just does not want to work. I get the "Fatal error: Call to
undefined function mysql_connect() in c:\Inetpub\wwwroot\mysqlconnect.php
on line 2" error.

Any help would be greatly appreciated.

Regards,
Tony Aldemir



--
MySQL Windows Mailing List
For list archives: http://lists.mysql.com/win32
To unsubscribe: http://lists.mysql.com/win32?unsub=gcdmw-win32@m.gmane.org

Re: Fatal error: Call to undefined function mysql_connect() in c:/Inetpub/wwwroot/mysqlconnect.php o

am 25.08.2005 22:19:33 von Daniel da Veiga

On 8/25/05, Tony_Aldemir@edwards.com wrote:
> Hello There,
>=20
> I am getting the "Fatal error: Call to undefined function mysql_connect()
> in c:\Inetpub\wwwroot\mysqlconnect.php on line 2" error when I try to
> connect to the MySQL DB using:
> > $conn =3D mysql_connect("localhost", "joeuser", "somepass");
> echo $conn;
> ?>
>=20
> I have made sure that my PHP.INI file is adjusted to reflect the followin=
g:

You can always use the phpinfo() function to generate a page with all
the information about the php installation, maybe your php isn't
configured correctly. Check for the mysql section and see if its all
working...
=20
> Uncommented the line "extension=3Dphp_mysql.dll" exposing this DLL to PHP=
..
> I added the following line
> extension_dir =3D "c:\php\ext"
>=20
> I copied the libmySQL.dll to the c:\inetpub\wwwroot folder (I am using th=
e
> IIS on this machine, but I have the same configuration using the latest
> APACHE Server on my home machine and when It try the same code on that
> machine, I get no response showing me the value of the $conn, but I do no=
t
> get any error message either). Confusing situation!

I know nothing about IIS, so, I can't help you there. But you see,
$conn is an object, so, it can't be "echoed", I get "Resource id #3"
from the echo.
=20
> I do have the php_mysql.dll in the C:\php\ext folder
>=20
> Well, none of this seem to matter. I am still getting the error listed
> above using IIS .
>=20
> Here is my setup:
> I have MySQL 4.1.13a-nt installed. I am able to run MySQL Admin to add
> users, add tables to the TEST DB, add records to the new table via the
> command line as well as via the MySQL Query Browser. So I am pretty sure
> that my MySQL is installed and working fine.)
>=20
> I have the MySQL program installed on the default location "C:\Program
> Files\MySQL\MySQL Server 4.1" as oppose to changing it to c:\MySQL folder
> during the installation. I am hoping that this is not the reason for thi=
s
> problem, but I am not sure.
>=20
> I am able to run other non-MySQL related simple PHP code via my browser
> just fine.
> (Example:
>
> Hello World

'; ?>
> and a few other simlar stuff. That all works fine.
>=20
> But when I use the
> > $conn =3D mysql_connect("localhost", "joeuser", "somepass");
> echo $conn;
> ?>
> code it just does not want to work. I get the "Fatal error: Call to
> undefined function mysql_connect() in c:\Inetpub\wwwroot\mysqlconnect.php
> on line 2" error.
>=20
> Any help would be greatly appreciated.
>=20
> Regards,
> Tony Aldemir
>=20
>=20
>=20

It's clearly a problem with PHP that's not recognizing the MySQL
extension... I don't see why this is happening, since PHP should be
compiled with mysql support... Anyway, try the phpinfo() and see what
it says about mysql...

--=20
Daniel da Veiga
Computer Operator - RS - Brazil
-----BEGIN GEEK CODE BLOCK-----
Version: 3.1
GCM/IT/P/O d-? s:- a? C++$ UBLA++ P+ L++ E--- W+++$ N o+ K- w O M- V-
PS PE Y PGP- t+ 5 X+++ R+* tv b+ DI+++ D+ G+ e h+ r+ y++
------END GEEK CODE BLOCK------

--
MySQL Windows Mailing List
For list archives: http://lists.mysql.com/win32
To unsubscribe: http://lists.mysql.com/win32?unsub=3Dgcdmw-win32@m.gmane.org