rabmerab Posted April 21, 2008 Share Posted April 21, 2008 Hi there, After stangling to make php and apache server works ( success at last ), now I am having problem using mysql. The installaion went with no problem. I can use it in console ( under dos ) with no problem but when I try to using it in php that's where I am craying for help. Bellow is php script: <?php $conn = mysql_connect("somedomain", "some_user, "soem_passord") or die ("Hey loser, check your server connection."); ?> and this is the HTMl output: Fatal error: Call to undefined function mysql_connect() in C:\Program Files\Apache group\Apache2.2\htdocs\connect.php on line 6 Any ideas please. rabmerab Quote Link to comment Share on other sites More sharing options...
GameYin Posted April 21, 2008 Share Posted April 21, 2008 Show us the stuff you type in for the parameters, except for password of course Try something like this. <?php $conn = mysql_connect('localhost', 'mysql_user', 'mysql_password'); if (!$conn) { die('Could not connect: ' . mysql_error()); } echo 'Connected successfully'; mysql_close($conn); ?> Also set error reporting on. Quote Link to comment Share on other sites More sharing options...
PFMaBiSmAd Posted April 21, 2008 Share Posted April 21, 2008 Please bother to read the error message - "Call to undefined function mysql_connect()" The mysql extension is not enabled in your php.ini. This is a common "first step" problem. There are literally hundreds of posts in this forum describing how to enable the mysql extension. Use the forum's search function and you will find the solution. Quote Link to comment Share on other sites More sharing options...
fenway Posted April 21, 2008 Share Posted April 21, 2008 And a sticky in the child forum, too. Quote Link to comment Share on other sites More sharing options...
rabmerab Posted April 21, 2008 Author Share Posted April 21, 2008 I did manage to make it works. the steps with i did follow are : copy libmysql.dll php5apache2.dll php5apache.dll php5ts.dll php_mysql.dll to C:\windows\system32 add extension_dir = "C:\php\ext" extension=php_mysql.dll to php.ini Thanks every 0ne rabmerab Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.