Parse error: syntax error php

Résolu/Fermé
moulesfrites Messages postés 25 Date d'inscription mercredi 22 avril 2009 Statut Membre Dernière intervention 29 mai 2009 - 29 mai 2009 à 13:05
pyschopathe Messages postés 1973 Date d'inscription dimanche 2 mars 2008 Statut Membre Dernière intervention 22 mars 2010 - 29 mai 2009 à 14:36
Bonjour, j'ai simplifié mon script au max et j'ai tjs l'erreur suivante sur le site

Parse error: syntax error, unexpected T_LOGICAL_OR in /data/nfs/ftp/00/50/49/root/index.php on line 12

<!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" lang="fr"><head><title>Mini-chat</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<link rel="stylesheet" href="style.css" type="text/css" />
</head><body>
<?php
$reponse="";
mysql_connect("localhost", "user2-5049-0", "*****")or die("erreur de connexion au serveur $host"); // Connexion à MySQL
mysql_select_db("bdfete"); // Sélection de la base
$reponse = mysql_query("SELECT * FROM tablebuffet ORDER BY genrebuffet");
$donnees="";
while ($donnees = mysql_fetch_array($reponse) ) or die(mysql_error()) //boucle tab buffet poisson
{

}
mysql_close();
?>

bla bla
</body>
</html>


merci pour vos réponses

4 réponses

pyschopathe Messages postés 1973 Date d'inscription dimanche 2 mars 2008 Statut Membre Dernière intervention 22 mars 2010 135
29 mai 2009 à 13:09
Cette expression n'a aucun sens :
while ($donnees = mysql_fetch_array($reponse) ) or die(mysql_error())
Enlève le or die() et ça devrait marcher.
0
moulesfrites Messages postés 25 Date d'inscription mercredi 22 avril 2009 Statut Membre Dernière intervention 29 mai 2009
29 mai 2009 à 13:15
merci pour ta réponse mais je l'ai fait et j'avais cette ceci :

Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /data/nfs/ftp/00/50/49/root/index.php on line 12
0
pyschopathe Messages postés 1973 Date d'inscription dimanche 2 mars 2008 Statut Membre Dernière intervention 22 mars 2010 135
29 mai 2009 à 13:18
$reponse = mysql_query("SELECT * FROM tablebuffet ORDER BY genrebuffet");
if ( !$reponse ) die(mysql_error()) ;
while ($donnees = mysql_fetch_array($reponse) )
Tu sauras d'où vient l'erreur.
0
moulesfrites Messages postés 25 Date d'inscription mercredi 22 avril 2009 Statut Membre Dernière intervention 29 mai 2009
29 mai 2009 à 13:24
No database selected

merci résolu
0
pyschopathe Messages postés 1973 Date d'inscription dimanche 2 mars 2008 Statut Membre Dernière intervention 22 mars 2010 135
29 mai 2009 à 14:36
Et ouala ^^ !
0