mysql_connect() error
Moderator: General Moderators
mysql_connect() error
Hello everyone
This is my first post on this forum.
i m a newbie in php infact in programming.
i have the mysql_connect() error on the page.
thankx in advance
This is my first post on this forum.
i m a newbie in php infact in programming.
i have the mysql_connect() error on the page.
thankx in advance
- John Cartwright
- Site Admin
- Posts: 11470
- Joined: Tue Dec 23, 2003 2:10 am
- Location: Toronto
- Contact:
You should use the mysql_error() to help you figure out what is wrong.
Or use the example given on the PHP manual for mysql_connect, which is:
Or if you're getting an 'undefined function mysql_connect' then you need to enable mysql support
Or use the example given on the PHP manual for mysql_connect, which is:
Code: Select all
<?php
$link = mysql_connect('localhost', 'mysql_user', 'mysql_password');
if (!$link) {
die('Could not connect: ' . mysql_error());
}
echo 'Connected successfully';
mysql_close($link);
?>Set Search Time - A google chrome extension. When you search only results from the past year (or set time period) are displayed. Helps tremendously when using new technologies to avoid outdated results.
thanks for such quick response
thanks for such quick response. m sure will find a solution here
have used the mysql_error() func.
error : call to an undefined function mysql_connect()
i m using php in iis
have used the mysql_error() func.
error : call to an undefined function mysql_connect()
i m using php in iis
I had this error when I used PHP 5. I downgraded to PHP 4.3 and everything worked out fine.
However, I wouldn't recommend doing that. You have to enable mysql support or something or other, in which case I couldn't tell you what to do. Although someone in here should be along shortly with a more precise answer.
However, I wouldn't recommend doing that. You have to enable mysql support or something or other, in which case I couldn't tell you what to do. Although someone in here should be along shortly with a more precise answer.
Set Search Time - A google chrome extension. When you search only results from the past year (or set time period) are displayed. Helps tremendously when using new technologies to avoid outdated results.
- John Cartwright
- Site Admin
- Posts: 11470
- Joined: Tue Dec 23, 2003 2:10 am
- Location: Toronto
- Contact:
viewtopic.php?t=23651&highlight=call+un ... sqlconnect
or search "call to an undefined function mysql_connect()" with search for all terms...
this has been discussed and solved many, many times.
or search "call to an undefined function mysql_connect()" with search for all terms...
this has been discussed and solved many, many times.
Indeed.
Basically, you're on PHP 5 and it doesn't include MySQL out of the box like PHP 4 did. You'll need to install it and configure your setup to enable it.
Check out the link Jcart posted for more info. And don't be a stranger to the manual!
http://www.php.net/mysql
Basically, you're on PHP 5 and it doesn't include MySQL out of the box like PHP 4 did. You'll need to install it and configure your setup to enable it.
Check out the link Jcart posted for more info. And don't be a stranger to the manual!
now get the error the cgi timed out
I am trying to install php on iis on my web server. what all i tried is here :
1. did uncomment php_mysql.dll
2. i installed php5 through an auto installer so didnt get the ext folder which has the dll files so i downloaded the windows zip package and copied the ext folder to c:\php
3. set the path of extension_dir="c:\php\ext\"
4. did set the environment variable to php. mean i added the following to the entry of path in system variables ;c:\php . this was done i guess so that the php and mysql can communicate with each other
before trying anything of the above i mean apart from using the php auto installer i was able to run the php pages atleast.
now even the page which has just the phpinfo stmt is showing a cgi timed out errror
i do not know what am i lagging here.
thanks in advance for the help offered
1. did uncomment php_mysql.dll
2. i installed php5 through an auto installer so didnt get the ext folder which has the dll files so i downloaded the windows zip package and copied the ext folder to c:\php
3. set the path of extension_dir="c:\php\ext\"
4. did set the environment variable to php. mean i added the following to the entry of path in system variables ;c:\php . this was done i guess so that the php and mysql can communicate with each other
before trying anything of the above i mean apart from using the php auto installer i was able to run the php pages atleast.
now even the page which has just the phpinfo stmt is showing a cgi timed out errror
i do not know what am i lagging here.
thanks in advance for the help offered
i know that mostly php is used on apache but here it is a compulsion for me to use iis
m not sure how to check for the errors that have asked for
but in iis settings i have even tried to make the php as isapi by doing the following:
1) in iis -> isapi filters added the php in isapi filters.
filter name : php
executable : C:\php\php5isapi.dll
2) in home directory -> configurations -> application mappings
executable :C:\php5\php5isapi.dll
extension : .php
m not sure how to check for the errors that have asked for
but in iis settings i have even tried to make the php as isapi by doing the following:
1) in iis -> isapi filters added the php in isapi filters.
filter name : php
executable : C:\php\php5isapi.dll
2) in home directory -> configurations -> application mappings
executable :C:\php5\php5isapi.dll
extension : .php