TJMAudio Posted January 24, 2007 Share Posted January 24, 2007 How do I use mysql_connect in PHP5.1.5?Here is my code:[code]<?phpdefine('HOST', 'localhost');define('USER', 'username');define('PASS', 'password');mysql_connect(HOST, USER, PASS) or die(mysql_error());[/code]It gives me this error:[quote]Warning: mysql_connect() [function.mysql-connect]: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2) in /h/web8/b13/pow/htdocs/index.php on line 10[/quote] Quote Link to comment https://forums.phpfreaks.com/topic/35539-mysql_connect-in-php5/ Share on other sites More sharing options...
Jessica Posted January 24, 2007 Share Posted January 24, 2007 Is the server actually localhost? Quote Link to comment https://forums.phpfreaks.com/topic/35539-mysql_connect-in-php5/#findComment-168237 Share on other sites More sharing options...
TJMAudio Posted January 24, 2007 Author Share Posted January 24, 2007 Nope... thanks :P Quote Link to comment https://forums.phpfreaks.com/topic/35539-mysql_connect-in-php5/#findComment-168239 Share on other sites More sharing options...
Jessica Posted January 24, 2007 Share Posted January 24, 2007 Then you'll need to use the correct host...Or were you just trying to hide your host info? Quote Link to comment https://forums.phpfreaks.com/topic/35539-mysql_connect-in-php5/#findComment-168243 Share on other sites More sharing options...
TJMAudio Posted January 24, 2007 Author Share Posted January 24, 2007 [quote author=jesirose link=topic=123853.msg512461#msg512461 date=1169659084]Then you'll need to use the correct host...Or were you just trying to hide your host info?[/quote]That was the problem, it's fixed now. Quote Link to comment https://forums.phpfreaks.com/topic/35539-mysql_connect-in-php5/#findComment-168248 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.