logo
Apache Lounge
Webmasters

 

About Forum Index Downloads Search Register Log in RSS X


Keep Server Online

If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.

or

Bitcoin

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.
Post new topic   Forum Index -> Other Software View previous topic :: View next topic
Reply to topic   Topic: Call to undefined function mysql_connect()
Author
mr8111



Joined: 28 Dec 2012
Posts: 4
Location: wuhan

PostPosted: Sat 29 Dec '12 14:40    Post subject: Call to undefined function mysql_connect() Reply with quote

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? Rolling Eyes
Back to top
James Blond
Moderator


Joined: 19 Jan 2006
Posts: 7371
Location: Germany, Next to Hamburg

PostPosted: Tue 08 Jan '13 12:34    Post subject: Reply with quote

You need to enable the mysql extension in your php.ini
Back to top


Reply to topic   Topic: Call to undefined function mysql_connect() View previous topic :: View next topic
Post new topic   Forum Index -> Other Software