Re: Thanks

From: Date: Mon, 30 Sep 2002 00:24:02 +0000
Subject: Re: Thanks
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-118135@lists.php.net to get a copy of this message
Thank you Sascha and Matt you got it ! Everything is working fine now. There is a lot of printing error in this book :( Regards! Voisine Voisine wrote: > Hello, > > I'm learning PHP from a book "PHP for newbie writen in French" and I > have an error on one of the exemple. Undifined constant 'compteur' on > line 15 which is : > if (compteur == 1) { > > What I'm doing wrong? This is the script > > <?php > include("config.inc.php"); > $query = "SELECT * FROM Type ORDER BY animalType"; > $result = mysql_query($query) or die ("Exécution de la sélection > impossible"); > > echo "<h1 align='center'>Catalogue</h1><p><h3>Quel type > d'animal > cherchez-vous ?</h3>\n"; > echo "<form action='montre_animaux.php' method='post'>\n"; > echo "<table cellpadding='5' border='1'>"; > $compteur = 1; > while ($ligne = mysql_fetch_array($result)) { > extract($ligne); > echo "<tr><td valign='top' width='15%'>"; > echo "<input type='radio' name='interet' > value='$animalType'>"; > if (compteur == 1) { > echo "checked"; > } > echo "<font > > size='+1'><b>$animalType</b></font></td><td>$typeDescription</td></tr>"; > > $compteur++; > } > echo "</table>"; > echo "<p><input type='submit' name='submit' > value='Faites votre > choix'></form>"; > ?>

« previous php.general (#118135) next »