Jump to content

Call to undefined function mysql_connect()


Recommended Posts

Good morning All, I am 2 days old using php now and I am having problems connecting to the database.

 

I have installed PHP (php-5.2.6-Win32.zip) and Apache2.2 (apache_2.2.9-win32-x86-no_ssl-r2.msi). I used the tutorial found in this link to configure. http://www.geocities.com/noluv4nerds/. Everything is going well and I am able to see my details when i run phpinfo().

 

However, when I use the following bits of code I get the error indicated in my subject line.

<?php
$link = mysql_connect('localhost', 'root', 'root');
if (!$link) {
    die('Could not connect: ' . mysql_error());
}
echo 'Connected successfully';
mysql_close($link);
?>

 

I have been at this for 2 and a half days now and I have looked that these links and many more but nothing seems to work.  >:(

1. http://www.phpfreaks.com/forums/index.php/topic,95378.0.html

2. http://www.siteinaweek.com/installphp5/howto.php#apache

 

Can someone please provide some further guidance. Any help will be greatly appreciated!!!!!

 

dallr

 

Link to comment
Share on other sites

To enable extensions, once your system is setup correctly, it is not necessary to copy any files around to different folders (which makes upgrading difficult.)

 

Yeah, because copying and pasting one file during an upgrade is just too much to ask :)

 

He asked how to fix it... not upgrade it down the road, I was just trying to get him working.

Link to comment
Share on other sites

Yeah, because copying and pasting one file during an upgrade is just too much to ask :)

 

Will you remember to do it each time? Just asking ;)

It's not a proper fix, but better than nothing.

 

It would be good if dallr told us what did he actually tried and achieved.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.