Jump to content

mysql_connect in PHP5?


TJMAudio

Recommended Posts

How do I use mysql_connect in PHP5.1.5?

Here is my code:
[code]
<?php
define('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]
Link to comment
https://forums.phpfreaks.com/topic/35539-mysql_connect-in-php5/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.