note 98062 added to function.mysql-fetch-array

[email protected]
Newsgroups php.notes
Message-ID <[email protected]>
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!
----
Server IP: 69.147.83.197
Probable Submitter: 86.63.34.111
----
Manual Page -- http://www.php.net/manual/en/function.mysql-fetch-array.php
Edit        -- https://master.php.net/note/edit/98062
Del: integrated  -- https://master.php.net/note/delete/98062/integrated
Del: useless     -- https://master.php.net/note/delete/98062/useless
Del: bad code    -- https://master.php.net/note/delete/98062/bad+code
Del: spam        -- https://master.php.net/note/delete/98062/spam
Del: non-english -- https://master.php.net/note/delete/98062/non-english
Del: in docs     -- https://master.php.net/note/delete/98062/in+docs
Del: other reasons-- https://master.php.net/note/delete/98062
Reject      -- https://master.php.net/note/reject/98062
Search      -- https://master.php.net/manage/user-notes.php
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.