dallr Posted August 26, 2008 Share Posted August 26, 2008 Good morning All, I am 2 days old using php now and I am having problems connecting to the database. I have installed PHP (php-5.2.6-Win32.zip) and Apache2.2 (apache_2.2.9-win32-x86-no_ssl-r2.msi). I used the tutorial found in this link to configure. http://www.geocities.com/noluv4nerds/. Everything is going well and I am able to see my details when i run phpinfo(). However, when I use the following bits of code I get the error indicated in my subject line. <?php $link = mysql_connect('localhost', 'root', 'root'); if (!$link) { die('Could not connect: ' . mysql_error()); } echo 'Connected successfully'; mysql_close($link); ?> I have been at this for 2 and a half days now and I have looked that these links and many more but nothing seems to work. 1. http://www.phpfreaks.com/forums/index.php/topic,95378.0.html 2. http://www.siteinaweek.com/installphp5/howto.php#apache Can someone please provide some further guidance. Any help will be greatly appreciated!!!!! dallr Quote Link to comment https://forums.phpfreaks.com/topic/121414-call-to-undefined-function-mysql_connect/ Share on other sites More sharing options...
trq Posted August 26, 2008 Share Posted August 26, 2008 Did you read the sticky at the top of this board? Quote Link to comment https://forums.phpfreaks.com/topic/121414-call-to-undefined-function-mysql_connect/#findComment-626078 Share on other sites More sharing options...
MatthewJ Posted August 26, 2008 Share Posted August 26, 2008 IF your php info page does not show mysql, try copying libmysql.dll to the windows directory... I think the last time I ran into this that was the problem. Hope that helps, Matt Quote Link to comment https://forums.phpfreaks.com/topic/121414-call-to-undefined-function-mysql_connect/#findComment-626090 Share on other sites More sharing options...
PFMaBiSmAd Posted August 26, 2008 Share Posted August 26, 2008 To enable extensions, once your system is setup correctly, it is not necessary to copy any files around to different folders (which makes upgrading difficult.) Quote Link to comment https://forums.phpfreaks.com/topic/121414-call-to-undefined-function-mysql_connect/#findComment-626097 Share on other sites More sharing options...
MatthewJ Posted August 26, 2008 Share Posted August 26, 2008 To enable extensions, once your system is setup correctly, it is not necessary to copy any files around to different folders (which makes upgrading difficult.) Yeah, because copying and pasting one file during an upgrade is just too much to ask He asked how to fix it... not upgrade it down the road, I was just trying to get him working. Quote Link to comment https://forums.phpfreaks.com/topic/121414-call-to-undefined-function-mysql_connect/#findComment-626225 Share on other sites More sharing options...
Mchl Posted August 26, 2008 Share Posted August 26, 2008 Yeah, because copying and pasting one file during an upgrade is just too much to ask Will you remember to do it each time? Just asking It's not a proper fix, but better than nothing. It would be good if dallr told us what did he actually tried and achieved. Quote Link to comment https://forums.phpfreaks.com/topic/121414-call-to-undefined-function-mysql_connect/#findComment-626245 Share on other sites More sharing options...
MatthewJ Posted August 27, 2008 Share Posted August 27, 2008 Will you remember to do it each time? Just asking It's not a proper fix, but better than nothing. It would be good if dallr told us what did he actually tried and achieved. I totally agree... Just givin' ya some grief Quote Link to comment https://forums.phpfreaks.com/topic/121414-call-to-undefined-function-mysql_connect/#findComment-627199 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.