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

[email protected]
Newsgroups php.notes
Message-ID <[email protected]>
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!
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.