Can't connect to local MySQL server through socket

Ask about a PHP problem here.
Post Reply
techm3
Posts: 12
Joined: Wed Dec 28, 2011 3:34 pm

Can't connect to local MySQL server through socket

Post by techm3 »

Here I'm again. I'm using this code (From line 142 - 196):
function fetch_business_info($name){	
	$sql = "SELECT 
			`b_name`,
			`b_address`,
			`b_city`,
			`b_country`,
			`b_category`,
			`b_email`,
			`b_website`
		FROM `business_information`
		WHERE `b_name` = '{$name}'";

	$result = mysql_query($sql);

	return mysql_fetch_assoc($result);
}
//fetches business events
function fetch_business_events($name){	
	$sql = "SELECT 
			`ev1`,
			`ev2`,
			`ev3`,
			`ev4`,
			`ev5`
		FROM `business_events`
		WHERE `b_name` = '{$name}'";

	$result = mysql_query($sql);

	return mysql_fetch_assoc($result);
}

//fetches business offers
function fetch_business_offers($name){	
	$sql = "SELECT 
			`of1`,
			`of2`,
			`of3`,
			`of4`,
			`of5`
		FROM `business_offers`
		WHERE `b_name` = '{$name}'";

	$result = mysql_query($sql);

	return mysql_fetch_assoc($result);
}
This time I'm getting the following errors. Does anyone knows why?

Warning: mysql_query() [function.mysql-query]: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2) in /home/content/88/7299688/html/prosion/core/user.inc.php on line 162

Warning: mysql_query() [function.mysql-query]: A link to the server could not be established in /home/content/88/7299688/html/prosion/core/user.inc.php on line 162

Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in /home/content/88/7299688/html/prosion/core/user.inc.php on line 164

Warning: mysql_query() [function.mysql-query]: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2) in /home/content/88/7299688/html/prosion/core/user.inc.php on line 177

Warning: mysql_query() [function.mysql-query]: A link to the server could not be established in /home/content/88/7299688/html/prosion/core/user.inc.php on line 177

Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in /home/content/88/7299688/html/prosion/core/user.inc.php on line 179

Warning: mysql_query() [function.mysql-query]: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2) in /home/content/88/7299688/html/prosion/core/user.inc.php on line 193

Warning: mysql_query() [function.mysql-query]: A link to the server could not be established in /home/content/88/7299688/html/prosion/core/user.inc.php on line 193

Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in /home/content/88/7299688/html/prosion/core/user.inc.php on line 195
techm3
Posts: 12
Joined: Wed Dec 28, 2011 3:34 pm

Re: Can't connect to local MySQL server through socket

Post by techm3 »

Sorry! It was a Typo.

It's working.
Post Reply