Bonjour,
J'ai un léger problème.
J'ai voulu faire un système de création de news sur mon site en PHP, et j'ai quelques problèmes, voilà mon script :

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr" >
 
 
    <body>
 
<?php
mysql_connect("localhost", "MON LOGIN FTP", "MON MDP FTP");
mysql_select_db("news");//News = le nom de ma table BD dans MySQL
// On récupère les 5 dernières news
$retour = mysql_query('SELECT * FROM news ORDER BY id DESC LIMIT 0, 5');
while ($donnees = mysql_fetch_array($retour))
{
?>
<div class="news">
    <h3>
        <?php echo $donnees['titre']; ?>
        <em>le <?php echo date('d/m/Y à H\hi', $donnees['timestamp']); ?></em>
    </h3>
 
    <p>
    <?php
    // On enlève les éventuels antislash PUIS on crée les entrées en HTML (<br />)
    $contenu = nl2br(stripslashes($donnees['contenu']));
    echo $contenu;
    ?>
    </p>
</div>
<?php
} // Fin de la boucle des news
?>
</body>
</html>
mais voilà ce que sa me donne :

Warning: mysql_connect() [function.mysql-connect]: Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2) in /homez.110/deathrow/www/newsa.php on line 137

Warning: mysql_select_db() [function.mysql-select-db]: Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2) in /homez.110/deathrow/www/newsa.php on line 138

Warning: mysql_select_db() [function.mysql-select-db]: A link to the server could not be established in /homez.110/deathrow/www/newsa.php on line 138

Warning: mysql_query() [function.mysql-query]: Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2) in /homez.110/deathrow/www/newsa.php on line 140

Warning: mysql_query() [function.mysql-query]: A link to the server could not be established in /homez.110/deathrow/www/newsa.php on line 140

Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /homez.110/deathrow/www/newsa.php on line 141
Quel est le PB ? Merci d'avance !