Re: [PHP-DB] Display of fetched MySQL data?

2004-03-25 Thread W. D.
Thanks! mysql_fetch_assoc did the trick. At 07:08 3/25/2004, Ryszard Hapka wrote: >not only foreach ;) > >$r = mysql_query("select * from table"); >while($t = mysql_fetch_assoc($r)) { // or while ($t = >mysql_fetch_array($r)) <-- you will see difrends >foreach($t as $key => $value) { >

Re: [PHP-DB] Display of fetched MySQL data?

2004-03-25 Thread Ryszard Hapka
not only foreach ;) $r = mysql_query("select * from table"); while($t = mysql_fetch_assoc($r)) { // or while ($t = mysql_fetch_array($r)) <-- you will see difrends foreach($t as $key => $value) { echo "[".$key."] ".$value .""; } echo ""; } Ryszard Hapka wrote: Hi! use foreach

Re: [PHP-DB] Display of fetched MySQL data?

2004-03-25 Thread Ryszard Hapka
Hi! use foreach (www.php.net/foreach). Ryszard W. D. wrote: Hi Folks, I am trying to display a list of retrieved records, but can't seem to figure out how to do this properly. Here is what I am aiming for: $result = mysql_query($SQLqry); $NumRows = mysql_num_rows($result); $NumFields = mysq

[PHP-DB] Display of fetched MySQL data?

2004-03-24 Thread W. D.
Hi Folks, I am trying to display a list of retrieved records, but can't seem to figure out how to do this properly. Here is what I am aiming for: \n"; // Loop through the fields for ($FieldIdx = 1; $FieldIdx <= NumFields; $FieldIdx++) { // Display the fields and associated data