Re: While and echoing HTML

From: Date: Tue, 10 May 2005 08:19:13 +0000
Subject: Re: While and echoing HTML
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-214821@lists.php.net to get a copy of this message
Mary-Anne Nayler wrote:
Hi Mark, As far as I can see the only problem is that you have forgotten to add a semicolon after the i++
Mark: Since you are not displaying the counter, you really don't need to mess with $i. You can reduce your code to just : <?php $db = mysql_connect("localhost", "root", "grunger"); mysql_select_db("status",$db); $result = mysql_query("SELECT ProductTypes.product_type_detail FROM ProductTypes",$db); ?> <table aligh="center" border="2"> <tr> <td>Product Type</td> </tr> <?php while($myrow = mysql_fetch_assoc($result))
    echo "<tr><td>".$row['product_type']."</td></tr>";
} ?> </table> </body> </html>

« previous php.general (#214821) next »