Im using this code for mysql connection
$con = mysql_connect("localhost:/var/lib/mysql/mysql.sock", "abc" , "xyz");
if (!$con)
{
die('Could not connect: ');
}
mysql_select_db("database_name", $con);
Im including this file on the top of every php file that im using for parsing and then storing the data in database.Now when the original site gets down then my parsing files starts giving error "Warning: mysql_connect(): Too many connections in /home/clickindia/public_html/appuonline/db.php on line 2 Could not connect:"
What should i do to save my site from these errors.Do you think that i should use mysql_close($con); But how and where??? Im using die in my code is that correct or should i use close etc. plz help!!