Bonjour à tous, je suis hébergé chez "ifrance" et il m'on donné des identifiant pour ma base MySQL mais sa ne marche pas quand je veu ouvrir mon site, j'ai ses messages d'erreur la:
Warning: mysql_connect() [function.mysql-connect]: Unknown MySQL server host 'imysql103' (1) in /www/sites/1/ifrance.com/b/o/boosta.spetsnaz/site/administration/record_stat.php on line 43
Warning: mysql_select_db(): supplied argument is not a valid MySQL-Link resource in /www/sites/1/ifrance.com/b/o/boosta.spetsnaz/site/administration/record_stat.php on line 44
Warning: mysql_query() [function.mysql-query]: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2) in /www/sites/1/ifrance.com/b/o/boosta.spetsnaz/site/administration/record_stat.php on line 48
Warning: mysql_query() [function.mysql-query]: A link to the server could not be established in /www/sites/1/ifrance.com/b/o/boosta.spetsnaz/site/administration/record_stat.php on line 48
Erreur : INSERT INTO statistiques VALUES("", "2006-12-11 08:49:59", "/index.php?4&weborama=-1", "10.11.27.32, 10.11.27.32", "1", "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; FunWebProducts; Wanadoo 6.7; .NET CLR 1.1.4322; .NET CLR 2.0.50727)", "")
Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)
Je vous donne aussi mon code correspondant à la page d'erreur:
Merci d'avance pour vos réponses.
Warning: mysql_connect() [function.mysql-connect]: Unknown MySQL server host 'imysql103' (1) in /www/sites/1/ifrance.com/b/o/boosta.spetsnaz/site/administration/record_stat.php on line 43
Warning: mysql_select_db(): supplied argument is not a valid MySQL-Link resource in /www/sites/1/ifrance.com/b/o/boosta.spetsnaz/site/administration/record_stat.php on line 44
Warning: mysql_query() [function.mysql-query]: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2) in /www/sites/1/ifrance.com/b/o/boosta.spetsnaz/site/administration/record_stat.php on line 48
Warning: mysql_query() [function.mysql-query]: A link to the server could not be established in /www/sites/1/ifrance.com/b/o/boosta.spetsnaz/site/administration/record_stat.php on line 48
Erreur : INSERT INTO statistiques VALUES("", "2006-12-11 08:49:59", "/index.php?4&weborama=-1", "10.11.27.32, 10.11.27.32", "1", "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; FunWebProducts; Wanadoo 6.7; .NET CLR 1.1.4322; .NET CLR 2.0.50727)", "")
Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)
Je vous donne aussi mon code correspondant à la page d'erreur:
<?php
// récupération de l'heure courante
$date_courante = date("Y-m-d H:i:s");
// récupération de l'adresse IP du client (on cherche d'abord à savoir si il est derrière un proxy)
if(isset($_SERVER['HTTP_X_FORWARDED_FOR'])) {
$ip = $_SERVER['HTTP_X_FORWARDED_FOR'];
}
elseif(isset($_SERVER['HTTP_CLIENT_IP'])) {
$ip = $_SERVER['HTTP_CLIENT_IP'];
}
else {
$ip = $_SERVER['REMOTE_ADDR'];
}
// récupération du domaine du client
$host = $ip ['gethostbyaddr'];
// récupération du navigateur et de l'OS du client
$navigateur = $_SERVER['HTTP_USER_AGENT'];
// récupération du REFERER
if (isset($_SERVER['HTTP_REFERER'])) {
if (eregi($_SERVER['HTTP_HOST'], $_SERVER['HTTP_REFERER'])) {
$referer ='';
}
else {
$referer = $_SERVER['HTTP_REFERER'];
}
}
else {
$referer ='';
}
// récupération du nom de la page courante ainsi que ses arguments
if ($_SERVER['QUERY_STRING'] == "") {
$page_courante = $_SERVER['PHP_SELF'];
}
else {
$page_courante = $_SERVER['PHP_SELF'].'?'.$_SERVER['QUERY_STRING'];
}
// connexion à la base de données
$base = mysql_connect('*******', '********', '*******');//ligne 43
mysql_select_db('********', $base); //ligne 44
// insertion des éléments dans la base de données
$sql = 'INSERT INTO statistiques VALUES("", "'.$date_courante.'", "'.$page_courante.'", "'.$ip.'", "'.$host.'", "'.$navigateur.'", "'.$referer.'")';
mysql_query($sql) or die('Erreur : '.$sql.'<br />'.mysql_error()); //ligne 48
// fermeture de la connexion à la base de données
mysql_close();
?>
Merci d'avance pour vos réponses.