You are here: only displaying 1 of 2 results from mysql « PHP Language « IT news, forums, messages
only displaying 1 of 2 results from mysql

Posted by Marnok.com on 04/16/07 18:41

Here's a snip from my code:

$childinfo = mysql_query("SELECT * FROM data WHERE `parent`=".$g);
if (mysql_num_rows($childinfo) > 0)
{

echo mysql_num_rows($childinfo).'<br>';

while ($pass = mysql_fetch_array($childinfo))
{
echo 'some text here';
}

}



My problem:
the echo of mysql_num_rows displays 2 or 3 depending on number of records
but the 'some text here' displays only once, displaying last matching item
in DB. I would expect it to do once for each entry.
(of course in my live code this line displays info about retrieved row)

Am I doing/expecting something stupid I haven't thought about, or is
something actually going wrong?

--
*****************************************
http://www.marnok.com
*****************************************

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация