hi I just decided to learn php and how to work with databases so i downloaded the latest version of apache php and mysql but whenever i use the mysql_connect() function the browser displays "Fatal error: Call to undefined function mysql_connect()". anyone could help my please?
Yes, you're missing the MySQL ext/module/libs for PHP. Cite the versions of each: Apache, MySQL, & PHP (and operating system), and I'll see if I can give you a little more help. Remember too, the latest and greatest is not always the wisest combination. Cheers, JL
Have you used the function in a context like this ? And by the way : To see if you have installed MySQL correctly, make a page with just this on it: Also check that server Safe-mode is not enabled. If it's enabled, MySQL DB's won't work.
Thanx a lot for replies The versions are: mysql 5.0, apache http server 2.0.55, php 5.1.1, the code was: <?php require($_SERVER["DOCUMENT_ROOT"]."/config/db_config.php"); $connection = mysql_connect($db_host, $db_user, $db_password) or die("error connecting"); echo "connection made"; ?> the included file- config/db_config.php: <?php $db_host = "localhost"; $db_user = "php"; $db_password = "f00"; ?> its from a tutorial and it did work for them
well i just cant find out how to get it working or where to get this extention my php folder contains some mysql libraries(msql.dll, libmysql.dll) and i included the folder in the system paths which was recommended on the php page but thats all the info i found about it
By giving him false information that you can't use MySQL and safe mode? I'd hardly call that helping..
Dude. Chill .. What the hell ? I was helping the guy out. I never said i am a PHP expert. As a matter of fact i know NOTHING of PHP, and i still helped the guy. Keep wankering yourself, or get a grip on your life. Help others.