ARRGGGHHH

Need help installing PHP, configuring a script, or configuring a server? Then come on in and post your questions! We'll try to help the best we can!

Moderator: General Moderators

Post Reply
Monotoko
Forum Commoner
Posts: 64
Joined: Fri Oct 26, 2007 4:24 pm

ARRGGGHHH

Post by Monotoko »

sorry for the title, but i feel like killing something at the moment, i have installed:

apache - works fine
php - works fine
mysql - works fine

so, why, when i try to use the code at the bottom does it come up with

Fatal error: Call to undefined function mysql_connect() in C:\Program Files\Apache Group\Apache2\htdocs\test.php on line 5

Code: Select all

<?
 
$con = mysql_connect("localhost","xxxx","xxxx");
if (!$con)
  {
  die('Could not connect: ' . mysql_error());
  }
 
?>
thanks for any help ~ Monotoko
User avatar
VladSun
DevNet Master
Posts: 4313
Joined: Wed Jun 27, 2007 9:44 am
Location: Sofia, Bulgaria

Re: ARRGGGHHH

Post by VladSun »

You need to install/configure PHP with MySQL support.
There are 10 types of people in this world, those who understand binary and those who don't
Monotoko
Forum Commoner
Posts: 64
Joined: Fri Oct 26, 2007 4:24 pm

Re: ARRGGGHHH

Post by Monotoko »

ok, how do i do that?

(sorry, i havent tried to set my own server up before and do not know how to do it)
User avatar
Christopher
Site Administrator
Posts: 13596
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

Re: ARRGGGHHH

Post by Christopher »

You need to enable the mysql extension in your php.ini file. See the PHP manual.
(#10850)
User avatar
Kieran Huggins
DevNet Master
Posts: 3635
Joined: Wed Dec 06, 2006 4:14 pm
Location: Toronto, Canada
Contact:

Re: ARRGGGHHH

Post by Kieran Huggins »

if you're on Windows you may just need to uncomment the mysql.dll line in php.ini

sqlite is built-in to php5 by default, so that may be an alternative.
Post Reply