note 98062 deleted from function.mysql-fetch-array by visualmind

From: Date: Mon, 24 May 2010 12:04:58 +0000
Subject: note 98062 deleted from function.mysql-fetch-array by visualmind
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-169552@lists.php.net to get a copy of this message
Note Submitter: moremarshmallows at gmail dot com Reason: useless ---- I observed that whilst using Wampserver on Windows (Apache 2.2.11, PHP 5.3.0, MySQL 5.1.41) if I were to do: <?php while ($row = mysql_fetch_array(mysql_query("SELECT * FROM cats")) { echo $row['Kitty']; } ?> It would only echo one row repeatedly, but if I were to do: <?php $q = mysql_query("SELECT * FROM alliances"); while ($row = mysql_fetch_array($q)) { echo $row['Kitty']; } ?> It would work fine! Just a reminder to anyone who forgets!

« previous php.notes (#169552) next »