par
vdrouet » 03 avr. 2015, 10:02
J'ai le message Parse error: syntax error, unexpected end of file mais après avoir relus plusieurs fois mon code je ne trouve pas d'erreurs
<?php
include ("prologue.php");
// FONCTIONS DE CONNEXION
function connect()
{
$hote="localhost";
$login="massimo";
$mdp="massimo";
return mysql_connect($hote, $login, $mdp);
}
function selectBase($connexion)
{
$bd="magasins-massimo";
$query="SET CHARACTER SET utf8";
// Modification du jeu de caractères de la connexion
$res=mysql_query($query, $connexion);
$ok=mysql_select_db($bd, $connexion);
return $ok;
}
//CONNEXION AU SERVEUR MYSQL PUIS SÉLECTION DE LA BASE DE DONNÉES magasins_massimo
$connexion=connect();
if (!$connexion)
{
ajouterErreur("Echec de la connexion au serveur MySql");
afficherErreurs();
exit();
}
if (!selectBase($connexion))
{
ajouterErreur("La base de données magasins_massimo est inexistante ou non accessible");
afficherErreurs();
exit();
// FONCTIONS DE GESTION DES PAYS
function obtenirReqPays()
{
$req="select id, nom_fr_fr from pays order by id";
return $req;
}
// Fonctions de gestions des villes
function obtenirReqVille()
{
$req="select id, nom from ville order by id";
return $req;
}
// FONCTIONS DE GESTION DES MAGASINS
function obtenirReqMagasin()
{
$req="select * from magasin order by id";
return $req;
}
echo '<form action="script.php" method post">';
echo "<p />Selectionner le pays ou votre magasin se situe<p />";
echo '<select name="pays" size="5">';
$resultat = mysql_query($req,$connexion);
{
echo "<option value=\"".$pays["nom_fr_fr"]."\"";
echo ">".$pays['nom_fr_fr']."</option>\n";
}
echo "<p />Selectionner la ville ou votre magasin se situe<p />";
echo '<select name="ville" size="5">';
$resultat = mysql_query($req,$connexion);
echo "<p />Selectionner le magasin de votre choix <p />";
echo '<select name="magasin" size="5">';
$resultat = mysql_query($req,$connexion);
?>
J'ai le message Parse error: syntax error, unexpected end of file mais après avoir relus plusieurs fois mon code je ne trouve pas d'erreurs
<?php
include ("prologue.php");
// FONCTIONS DE CONNEXION
function connect()
{
$hote="localhost";
$login="massimo";
$mdp="massimo";
return mysql_connect($hote, $login, $mdp);
}
function selectBase($connexion)
{
$bd="magasins-massimo";
$query="SET CHARACTER SET utf8";
// Modification du jeu de caractères de la connexion
$res=mysql_query($query, $connexion);
$ok=mysql_select_db($bd, $connexion);
return $ok;
}
//CONNEXION AU SERVEUR MYSQL PUIS SÉLECTION DE LA BASE DE DONNÉES magasins_massimo
$connexion=connect();
if (!$connexion)
{
ajouterErreur("Echec de la connexion au serveur MySql");
afficherErreurs();
exit();
}
if (!selectBase($connexion))
{
ajouterErreur("La base de données magasins_massimo est inexistante ou non accessible");
afficherErreurs();
exit();
// FONCTIONS DE GESTION DES PAYS
function obtenirReqPays()
{
$req="select id, nom_fr_fr from pays order by id";
return $req;
}
// Fonctions de gestions des villes
function obtenirReqVille()
{
$req="select id, nom from ville order by id";
return $req;
}
// FONCTIONS DE GESTION DES MAGASINS
function obtenirReqMagasin()
{
$req="select * from magasin order by id";
return $req;
}
echo '<form action="script.php" method post">';
echo "<p />Selectionner le pays ou votre magasin se situe<p />";
echo '<select name="pays" size="5">';
$resultat = mysql_query($req,$connexion);
{
echo "<option value=\"".$pays["nom_fr_fr"]."\"";
echo ">".$pays['nom_fr_fr']."</option>\n";
}
echo "<p />Selectionner la ville ou votre magasin se situe<p />";
echo '<select name="ville" size="5">';
$resultat = mysql_query($req,$connexion);
echo "<p />Selectionner le magasin de votre choix <p />";
echo '<select name="magasin" size="5">';
$resultat = mysql_query($req,$connexion);
?>