You are here: Re: printing collumn names then contents from mysql query « PHP Programming Language « IT news, forums, messages
Re: printing collumn names then contents from mysql query

Posted by Rik on 12/17/72 11:54

monomaniac21 wrote:
> how can i take every field from a table (where there are many) and
> without referencing by name (using a loop) echo there name in a td
> followed by the contents? i think the foreach statement is what im
> looking for? but i dont understand it.


$result = mysql_query'$query);
while($row = mysql_fetch_assoc($result){
echo '<tr>';
foreach($row as $key => $value){
echo "<td>{$key}:{$value}</td>";
}
echo '</tr>';
}

Grtz,
--
Rik Wasmus

 

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

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