[help] Problème avec php + mysql
Résolu
sofy16
Messages postés
14
Statut
Membre
-
sofy16 Messages postés 14 Statut Membre -
sofy16 Messages postés 14 Statut Membre -
Bonjour,
j'ai un problème quand je veux accéder à ma base de donnée en php.
J'ai une erreur :
Fatal error: Call to undefined function mysql_pconnect() in /home/sofy/public_html/projet/test.php on line 19
Voici le code php :
<?php session_start(); ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html dir="ltr" xml:lang="fr" xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Interrogation de bases de données en PHP</title>
<meta http-equiv="Content-Type" content="application/xhtml+xml; charset=ISO-8859-1"/>
</head>
<body>
<?php
$server = "127.0.0.1";
$user = "sofy";
$bd = "IO2";
$connexion = mysql_pconnect($server,$user) or die(mysql_error());
if(!$connexion) {
echo "Serveur injoignable!<br />";
}
else {
echo "Serveur joignable!!<br />";
}
$base = mysql_select_db($bd,$connexion);
if(!$base) {
echo "aucune base de données trouvée!<br />";
}
else {
echo "Base trouvée!! Cool!<br />";
}
echo "<br />";
?>
</body>
</html>
Si quelqu'un pouvais m'aider.... Merci
j'ai un problème quand je veux accéder à ma base de donnée en php.
J'ai une erreur :
Fatal error: Call to undefined function mysql_pconnect() in /home/sofy/public_html/projet/test.php on line 19
Voici le code php :
<?php session_start(); ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html dir="ltr" xml:lang="fr" xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Interrogation de bases de données en PHP</title>
<meta http-equiv="Content-Type" content="application/xhtml+xml; charset=ISO-8859-1"/>
</head>
<body>
<?php
$server = "127.0.0.1";
$user = "sofy";
$bd = "IO2";
$connexion = mysql_pconnect($server,$user) or die(mysql_error());
if(!$connexion) {
echo "Serveur injoignable!<br />";
}
else {
echo "Serveur joignable!!<br />";
}
$base = mysql_select_db($bd,$connexion);
if(!$base) {
echo "aucune base de données trouvée!<br />";
}
else {
echo "Base trouvée!! Cool!<br />";
}
echo "<br />";
?>
</body>
</html>
Si quelqu'un pouvais m'aider.... Merci
Configuration: Linux Firefox 1.5.0.12
2 réponses
-
Salut,
Tu n'aurais pas php 3 par hasard? -
Bien partons sur cette nouvelle base: il ne trouve pas le fichier mysql.so qui est la bibliothèque dynamique permettant de faire l'interface php/mysql.
Ce fichier est contenu dans le paquet php5-mysql
Donc il te reste à ouvrir synaptic et à installer php5-mysql :-)