Keep Server Online
If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.
or
A donation makes a contribution towards the costs, the time and effort that's going in this site and building.
Thank You! Steffen
Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
| |
|
Topic: Call to undefined function mysql_connect() |
|
Author |
|
mr8111
Joined: 28 Dec 2012 Posts: 4 Location: wuhan
|
Posted: Sat 29 Dec '12 14:40 Post subject: Call to undefined function mysql_connect() |
|
|
Admin note:
Splitted from www.apachelounge.com/viewtopic.php?t=5100 , subject does not match question.
i have configure mysql on system.
creat a new page called test.php
<?php
$host='localhost';
$user_name='root';
$password='sa';
$conn=mysql_connect($host,$user_name,$password);
if (!$conn)
{
die('connection fail:'.mysql_error());
}
echo 'connect to database success!';
if (mysql_close($conn))
{
echo '<br/>...<br/>';
echo 'connection closed';
}
?>
when i open this page,the results always wrong:
Fatal error: Call to undefined function mysql_connect()
what's the cause of this? |
|
Back to top |
|
James Blond Moderator
Joined: 19 Jan 2006 Posts: 7371 Location: Germany, Next to Hamburg
|
Posted: Tue 08 Jan '13 12:34 Post subject: |
|
|
You need to enable the mysql extension in your php.ini |
|
Back to top |
|
|
|
|
|
|