Hey everybody, just stuck here! since the error received is: Fatal error: Call to undefined function Mysql_connect() in C:\Apache2\Apache2\htdocs\study.php on line 3... Any experts can enlighten this for me? any problems with installing?...
Sure, very simple one: ---------------- <?php $link = mysql_connect("localhost","username","password"); if(!$link) die('Could not open connect:'.mysql_error()); else echo "Connected sucessfully!"; ?> ---------------- I want to mention that the function I used : mysql_connect() is undefined! So that is seemingly sure some problems with my soft, therefore problems with installation?.... Thanks for your interest. Help me, plzz!
are you running your own server? are the mysql functions enabled in your php setup? if you are, open up your php.ini file and perform a search for 'mysql'
what version of php are you running? mysql_connect is not set up by default on php 5 as it used to be on php 4. You need to access the php.ini file and enable this extension by uncommenting it. Hope this helps
After all try, I am still stuck!can you tell me how to enable these functions (mysql_connect(), mysql_error()...) in the php.ini file?
as i know unix/linux is case senitive, can you try renname the function with Mysql_connect(), the letter with capitalized 'M'., and try it to see wether it is ok
Since you are running this on windows, chances are you didn't install MySQL/PHP correctly. Theres some specific MySQL.dll files you need to move to the right places for MySQL to load up with PHP when you start Apache. Check your Apache error logs, theres probably something about not being able to load MySQL module.
Did you install Apache, PHP etc. individually? I'd recommend installing with a package installer such as XAMPP so you don't need to worry about issues like this. Back to the issue, have you checked if MySQL is even installed (and configured properly)? You can check error logs as MrMonster said or use phpinfo() to find out.
Thanks all and sorry for late respond! I did tried XAMPP, and one other soft similar like that(with a forum coming with) however, this is the traditional way, rite? should handle this first! All other normal-used functions are okey! Only can not connect to the database...:-( More abt this, I follow this link to configure Apache and Php: tanguay.info/wamp/installPhp5.php5?step=6
Finally, today (my off-day ) I found the line which disables MySQL extensions in php.ini. Just want to share to other newbie(like me) to quickly resolve it. ------- In Php.ini file, find the comment line: extension=php_mysql.dll and then remove the leading semicolon. That's all, u'r done! easy, rite? Thanks all, guys and gals!!