batiste.roger70
New Member
- Messages
- 10
- Reaction score
- 0
- Points
- 0
Hello.
I can't use MySQL.
This is my PHP code:
Of course, I have activated mysql-starka.x10hosting.com from C-panel.
When I open my page, the error is :
Erreur : SQLSTATE[HY000] [2003] Can't connect to MySQL server on 'mysql-starka.x10hosting.com' (111)
I don't know what is wrong with it...
Thank you.
I can't use MySQL.
This is my PHP code:
Code:
try
{
$pdo_options[PDO::ATTR_ERRMODE] = PDO::ERRMODE_EXCEPTION;
$bdd = new PDO('mysql:host=mysql-starka.x10hosting.com;dbname=test;post=3306','zagdem','mypassword');
$reponse = $bdd->query('SELECT pseudo, message FROM Livre_or ORDER BY ID DESC LIMIT 0, 10');
while ($donnees = $reponse->fetch())
{
echo '<p><strong>' . htmlspecialchars($donnees['pseudo']) . '</strong> : ' . htmlspecialchars($donnees['message']) . '</p>';
}
$reponse->closeCursor();
}
catch(Exception $e)
{
die('Erreur : '.$e->getMessage());
}
$reponse->closeCursor();
Of course, I have activated mysql-starka.x10hosting.com from C-panel.
When I open my page, the error is :
Erreur : SQLSTATE[HY000] [2003] Can't connect to MySQL server on 'mysql-starka.x10hosting.com' (111)
I don't know what is wrong with it...
Thank you.
Last edited: