Page 1 of 1
mysql_connect() error
Posted: Tue May 30, 2006 10:33 am
by beckbapegeneral
there is something wrong with my coding.. i am trying to create an connect in another .php file and to include it in my main .php file. but when i run in on the browser, there is a fatal error saying undefined call function mysql_connect(). anyone can help me please

Posted: Tue May 30, 2006 10:34 am
by Christopher
Please post the relevant code so we can see what is going wrong (obviously do not include connection username/password info).
Re: mysql_connect() error
Posted: Tue May 30, 2006 10:36 am
by RobertGonzalez
beckbapegeneral wrote:there is something wrong with my coding.. i am trying to create an connect in another .php file and to include it in my main .php file. but when i run in on the browser, there is a fatal error saying undefined call function mysql_connect(). anyone can help me please

If you are getting a call to an undefined function using mysql_connect then you do not have the mysql extension installed. Search these forums for how to install the mysql or mysqli extension by editing your php.ini file.
Posted: Tue May 30, 2006 9:25 pm
by beckbapegeneral
can you be kind enough to provide me url where i can learn how to configure my php.ini? thanks alot in advance
Posted: Tue May 30, 2006 10:14 pm
by RobertGonzalez
There should be plenty of threads and posts here about enableing extensions in php.ini. Do a quick search. It is usually something as simple as removing a semicolon from the front of a line in php.ini that looks like
Posted: Wed May 31, 2006 7:29 am
by beckbapegeneral
guys.. i think there is some serious problem.. it is that i have uncommented the extensions=php_mysql.dll but the browser is now displaying this error to me
Fatal error: Call to undefined function mysql_connect() in c:\Inetpub\wwwroot\opendb.php on line 2
PHP Warning: PHP Startup: Unable to load dynamic library './php_mssql.dll' - The specified module could not be found. in Unknown on line 0 PHP Warning: PHP Startup: Unable to load dynamic library './php_msql.dll' - The specified module could not be found. in Unknown on line 0 PHP Warning: PHP Startup: Unable to load dynamic library './php_mysql.dll' - The specified module could not be found. in Unknown on line 0
Posted: Wed May 31, 2006 8:33 am
by feyd
it's not a serious problem. Just make sure your extension_dir directive is set correctly.
Posted: Wed May 31, 2006 8:35 am
by RobertGonzalez
beckbapegeneral wrote:guys.. i think there is some serious problem.. it is that i have uncommented the extensions=php_mysql.dll but the browser is now displaying this error to me
Fatal error: Call to undefined function mysql_connect() in c:\Inetpub\wwwroot\opendb.php on line 2
PHP Warning: PHP Startup: Unable to load dynamic library './php_mssql.dll' - The specified module could not be found. in Unknown on line 0 PHP Warning: PHP Startup: Unable to load dynamic library './php_msql.dll' - The specified module could not be found. in Unknown on line 0 PHP Warning: PHP Startup: Unable to load dynamic library './php_mysql.dll' - The specified module could not be found. in Unknown on line 0
Look at the errors you are getting. That means that PHP cannot find your extensions. Either the extension folder entry in php.ini is incorrect or the .dll's are not in that folder. One or the other.
Posted: Wed May 31, 2006 9:11 am
by beckbapegeneral
i am using php installer to install my php and i downloaded the zip file and copied the ext folder to my php folder in c:\php . The extension_dir="C:\php" and the .dll files are in the ext folder. can someone please help me with the installation?

...
Posted: Wed May 31, 2006 9:35 am
by ok
First of all, look at the PHP manual (
http://www.php.net/manual/en/install.windows.php).
Secondly, the best thing to do is to install manually (with Apache):
http://www.php.net/manual/en/install.windows.manual.php .
If you don't want to install again, just change your ext dir to extension_dir=C:\php\extensions, and check that the mysql ext is in the extensions dir.
Posted: Wed May 31, 2006 9:56 am
by RobertGonzalez
beckbapegeneral,
You know, we may have been going about this all wrong. What version of PHP are you installing? Take a look at the
Installation of extensions on Windows page of the PHP manual. It mentions extensions that are pre-built into the Windows distibution and how to install extensions that are not already in the distro.