Jump to content

mysql_connect an undefined function??


aeroboy

Recommended Posts

Hello,

I have recently installed php5.1.4 and MySQL5.0.22 on my Windows Server 2003 server computer.  I tried a simple connect by creating a file with the following code:
[code]<html>
<body>
<?php
$con = mysql_connect('localhost','root','MyRootPassword');
if (!$con)
  {
  die("Could not connect: " . mysql_error());
  }
?>
</body>
</html>
[/code]

I get the following error message when I try to view this file in IE:

PHP Fatal error: Call to undefined function mysql_connect() in MyFileLocation on line 5

Can anyone help?
I installed php on my hard drive i.e. C:\php
I installed MySQL on my hard drive as well i.e C:\Program Files\MySQL

Thanks in advance
Link to comment
Share on other sites

Thanks, guys...
after researching and listening to you guys, I went to

<a href="http://dev.mysql.com/downloads/connector/php/"> http://dev.mysql.com/downloads/connector/php/
</a>

and downloaded the mysqli extension.  After that didn't work, the mysql extension worked fine.  Your linked thread was perfect, wildteen.

THANKS!!

8)
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.