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
https://forums.phpfreaks.com/topic/15144-mysql_connect-an-undefined-function/
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)

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.