You are here: Re: mysql_fetch_array for loop « PHP Programming Language « IT news, forums, messages
Re: mysql_fetch_array for loop

Posted by Sean on 10/26/78 11:33

Try

for($i=0;$i<rowsfound;$i++)
{
echo "Value is " . $row[$i]['close'];
}

that should work.

There was a really nice way of looping through records posted by Shawn
Wilson on alt.comp.lang.php.

$query = " SELECT * FROM `msgsummary` WHERE `userid` = '$userid' ORDER
BY
msgdate DESC";
$result = mysql_query($query) or die('Query failed: ' .
mysql_error());
while ($line = mysql_fetch_array($result, MYSQL_ASSOC)) {
foreach($line AS $_NAME => $_VALUE) { $$_NAME = $_VALUE; }

*** then do whatever you are going to do with that record ***
}

(http://groups.google.com/group/alt.comp.lang.php/browse_frm/thread/b9d5bae96ffa221a/d671978fdec725cc#d671978fdec725cc)

 

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

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