Jump to content

Fatal error: Call to undefined fuction mysql_conenct()


Recommended Posts

Hello, I'm sorry if I'm posting in the wrong section. I got a weird problem, I have two Computers with the same exact setup, Win XP Pro Sp2. Both with MySql server 5.0, PHP 5.2.9-2 and Apache 2.2.11. Now we get to the tricky part, on one of the computers I installed everything and everything works fine (it's a desktop.. don't know if it's important or not) the otherone which is a laptop... I installed everything. Apache, mysql and php all work correctly but the only problem that I'm getting is that php doesn't load mysql functions. I tryed about anything... I added c:\php and c:\php\ext to the PATH, I deleted and recreated php.ini in C:\Windows, I even tryed putting in C:\php instead of windows. I also tryed copying the files from the desktop to the laptop, but always the same error showed up. Could anyone please help me? If I left out any information that you need let me know. Thanks

Link to comment
Share on other sites

Did you enable mysql extension in php.ini?

 

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

 

Yes I did, even tryed enabling mysqli but nothing changes. I even copyed the libmysql.dll to c:\php\ext and to c:\windows.

 

Edit:

The only difference I can think of between the two computers is that on the laptop I had problems making apache to start, so I had to disable IIS Admin while on the desktop is still active, could that be the problem? But honestly I don't think it has anything to do with it.

Link to comment
Share on other sites

I'm assuming that since you say you have copied files across and the problem persists, that it's just a typo, but I figured I should mention it anyway. The error message in your title says mysql_conenct.

Link to comment
Share on other sites

I'm assuming that since you say you have copied files across and the problem persists, that it's just a typo, but I figured I should mention it anyway. The error message in your title says mysql_conenct.

 

lol  :shy: no thats not the problem I'm posting from the pc where evreything works correctly, I didn't copy and paste the error message. I'm pretty sure it's not a typo, I checked the files to many times.. I would of seen them.

Link to comment
Share on other sites

How about posting the actual line of code with the mysql_connect().

 

Is the php.ini that you are changing the one that php is using and did you stop and start your web server after making any change to the php.ini to get it to take effect?

 

The actual error is: "Fatal error: Call to undefined function mysql_connect() in C:\Programmi\Apache Software Foundation\Apache2.2\htdocs\mysql_test.php on line 8". I already checked the php.ini, and yes it's the right one, atleast i believe so. On phpinfo it points to the right file. Yes I tryed restarting the web server but nothing changes.

 

The Code:

 

$db= mysql_connect("localhost","root","prova");

 

if(!$db)

    {

        echo "<H1> errore </h1>";

        exit;

    }

 

else

    {

        mysql_select_db("test");

        $query = "select * from name";

    $result = mysql_query ($query);

        }

 

Link to comment
Share on other sites

Back to the basics. How did you obtain and install php, as that affects how you enable extensions. Specifically, did you use one of the WAMP package or the php .msi installer, or the php .zip package?

 

Is the php.ini that you are changing the same one in the Loaded Configuration File line in the phpinfo() output?

Link to comment
Share on other sites

Back to the basics. How did you obtain and install php, as that affects how you enable extensions. Specifically, did you use one of the WAMP package or the php .msi installer, or the php .zip package?

 

Is the php.ini that you are changing the same one in the Loaded Configuration File line in the phpinfo() output?

 

I installed php with the php .zip package, in the phpinfo() it says that the loaded one is in C:\windows and it's the one that I'm working on. To enable mysql I simply removed the ; before extension=mysql.dll. Everything seams perfect but for some strange reason it just won't work. I also checked if by chance there was another php.ini on the pc but I found nothing.

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.