Why while doesn't work?

From: Date: Thu, 24 Jan 2002 13:02:40 +0000
Subject: Why while doesn't work?
Groups: php.general 
Request: Send a blank email to php-general+get-81869@lists.php.net to get a copy of this message
Although the table con_inf in db sbwresearch contains 3 records with username as the first column, the following short script generates a blank page: <?php $connection=mysql_connect("localhost","wagner","xyz") or die ("No connection!"); $db=mysql_select_db("sbwresearch",$connection) or die ("No database!"); $qry_1="select * from con_inf"; $result_1=mysql_query($qry_1,$connection) or die ("No query # 1!"); while ($row_1=mysql_fetch_array($result_1,"mysql_assoc")) { $username=$row_1["username"]; echo "$username"; }; mysql_free_result($result_1); mysql_close($connection); exit; ?> Why? I've use the statement in other scripts and it works! Thanks!

« previous php.general (#81869) next »