Reply to Re: Displaying rows of data as collumns?

Your name:

Reply:


Posted by Zoe Blade on 01/22/06 16:14

> Does anyone know of an efficient way to retreive data from a mysql db
> and display the record rows as collumns?

You're probably best off putting each record row in an array, so you'd get
something like:

while ($row = mysql_fetch_array($result))
{
$rows[] = $row;
}

That way, you'll have access to all the results before you start drawing
your table. Then for each row of the table you print out, you can loop
through the array printing out the appropriate column of SQL output.

foreach ($rows as $row)
{
echo "<td>{$row['column_1']}</td>";
}

Perhaps something like that might work?

Hope that helps,
Zoe.

[Back to original 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

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