strange echo() effect

From: Date: Thu, 31 Oct 2002 20:26:20 +0000
Subject: strange echo() effect
Groups: php.general 
Request: Send a blank email to php-general+get-122318@lists.php.net to get a copy of this message
I have a small piece of code which does the following: 1) call a function to print an html header, 2) query a database to list the users in the db, 3) print an html footer. problem is it print out the footer before the table, even though it is called after. looking at the html source of the page in a browser, show that the table is first, why is this happening? here is the code: html_header(); echo "<table border=\"1\" width=\"80%\" cellpadding=\"0\" cellspacing=\"0\">\n"; echo "<tr>\n"; echo "<td><b>uid</b></td>\n"; echo "<td><b>username</b></td>\n"; echo "<td><b>password</b></td>\n"; echo "<td><b>session id</b></td>\n"; echo "<td><b>email address</b></td>\n"; echo "</tr>\n"; $query = "SELECT * FROM users LIMIT 0,30"; $result = mysql_query($query); while ($query_data = mysql_fetch_row($result)) { echo "<tr>\n"; foreach ($query_data As $column) { echo "\t<td>$column</td>\n"; } echo "</tr>\n"; } echo "<br><br>\n"; html_footer(); -- Mat Harris OpenGPG Public Key ID: C37D57D9 mat.harris@genestate.com matthewh.genestate.com

« previous php.general (#122318) next »