mysql_connect() undefined
Posted by: niceguy (---.dyn.optonline.net)
Date: March 28, 2007 08:50PM

hi all,

seems mysql_connect() is a common problem. but haven't seen anything for 'undefined':

Fatal error: Call to undefined function mysql_connect()

now, does "undefined" here mean literally as undefined function as if it is not there? how can that be? or it tried to access mysql but failed due to some problem?

my php scripts are running fine. created db and table using phpmyadmin. phpinfo() lists

C:\wamp\Apache2\bin\php.ini

which hasn't been changed. also searched the entire C:\ and found no php.ini, other than in C:\wamp. the whole install is basically default: don't think any file is changed. and everything is on localhost.

so what's wrong? what else should i check?

thanks!



Post Edited (03-28-07 20:52)

Options: ReplyQuote
Re: mysql_connect() undefined
Posted by: CyberSpatium (71.237.217.---)
Date: March 29, 2007 06:19AM

make sure there is a triangle next to php_mysql located here:

left click on the wamp tray icon -> php settings -> php extensions -> php_mysqln

if there is no triangle next to it, click on it to enable it. wamp will automatically make the changes in your php.ini file, and restart apache for the new settings to take effect.


CyberSpatium
----------------------
WAMP English Forum Admin

Need help? Check out my WAMP User Manual/Guide here!


Please visit my latest website Clarify Loans:
ClarifyLoans.com

Options: ReplyQuote
Re: mysql_connect() undefined
Posted by: niceguy (---.dyn.optonline.net)
Date: March 29, 2007 08:14AM

hmm? no php_mysqln listed. only php_mysql and php_mysqli, which is triangle-marked. tried the 'add extension' with php_mysqln and got 'no such extension on your system'.

so, you really mean php_mysqln? if so, and it is required to connect to mysql, how is it that it is missing from my download pack?

Options: ReplyQuote
Re: mysql_connect() undefined
Posted by: CyberSpatium (71.237.217.---)
Date: March 29, 2007 11:37AM

sorry, typo, i meant php_mysql.


CyberSpatium
----------------------
WAMP English Forum Admin

Need help? Check out my WAMP User Manual/Guide here!


Please visit my latest website Clarify Loans:
ClarifyLoans.com

Options: ReplyQuote
Re: mysql_connect() undefined
Posted by: roms (---.fbx.proxad.net)
Date: March 29, 2007 03:51PM

Do you see the extension "mysql" in your phpinfo?



Romain

Options: ReplyQuote
Re: mysql_connect() undefined
Posted by: fumanchu (12.154.112.---)
Date: March 29, 2007 05:05PM

Check your System Environment Variables to ensure the php directory is included in your PATH.

Right Click on "My Computer" - Properties - Advanced - Environment Variables - Double click on Path in the "System Variables" window - add C:\wamp\php\ (Or wherever your php directory is listed)

Options: ReplyQuote
Re: mysql_connect() undefined
Posted by: niceguy (---.dyn.optonline.net)
Date: March 31, 2007 11:04PM

thanks all for the help. problem solved by clicking the 'php_mysql' extension to active it, as suggested. i suppose it should be on by default but obviously not so in my install.

anyway, thanks again!

Options: ReplyQuote
Re: mysql_connect() undefined
Posted by: CyberSpatium (71.237.217.---)
Date: April 01, 2007 05:10AM

starting with php 5, the developers of php decided to make the mysql extension disabled by default. so, to enable it you have to do it yourself.


CyberSpatium
----------------------
WAMP English Forum Admin

Need help? Check out my WAMP User Manual/Guide here!


Please visit my latest website Clarify Loans:
ClarifyLoans.com

Options: ReplyQuote


Sorry, only registered users may post in this forum.