Forum Moderators: coopster

Message Too Old, No Replies

undefined function mysql_connect()

Apache/PHP/MySQL undefined function

         

angst

8:51 pm on Jun 23, 2005 (gmt 0)

10+ Year Member



Hello,

I just installed Apache/PHP/MySQL all newest versions today on windows XP with service pack2, everything seems to be working fine, cept for when I went to connect to MySQL.

I'm getting this error:

Fatal error: Call to undefined function mysql_connect() in C:\Program Files\Apache Group\Apache2\htdocs\national\inc\conntemp.inc on line 3

line 3 of conntemp is:

$db_selected = mysql_select_db('National', $link) or die('Database name incorrect');

but i know the code is good, it works fine on my linux server.
can anyone tell me if i'm missing something? like a module maybe?
and if so what one and where can i get it?

thanks in advance for your time!

-Ken

Burner

12:15 am on Jun 24, 2005 (gmt 0)

10+ Year Member



First thing you should probably do is create a php file on the webserver and call it something like info.php. In it it should only have:

<?php
phpinfo();
?>

Load it into your browser and scroll down through the information and look for a table titled mysql. If it doesn't exist, then your php was compiled without mysql support.

Burner

jatar_k

1:14 am on Jun 24, 2005 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



Welcome to WebmasterWorld angst,

maybe try these posts
Troubleshooting Steps for PHP/Apache on windows [webmasterworld.com]
Installing a new web server: Apache2, PHP5, MySQL4 and PHPmyAdmin [webmasterworld.com]

those might give you some tips on where to look

angst

3:59 am on Jun 24, 2005 (gmt 0)

10+ Year Member



well it looks like mysql was not included,

I thought I had missed something in the config but i can't figure out what it is. I've installed php many times on linux machines, but never on windows.

this should be interesting..

-Ken

angst

1:21 pm on Jun 24, 2005 (gmt 0)

10+ Year Member



ok,
so I used:
<?php
phpinfo();
?>

and it looks like mysql support was not installed?

does anyone know if i can install it now? or does it even come with the windows version of php?

thanks again for your time!

-Ken

jatar_k

4:18 pm on Jun 24, 2005 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



yes it does come with it

you can turn it on in php.ini, I believe you just need the dll, which you may already have in the appropriate spot.

uncomment the mysql lines in php.ini, restart apache and see what happens ;)