You are here: Re: Crosstab Report « PHP Programming Language « IT news, forums, messages
Re: Crosstab Report

Posted by Geoff Berrow on 05/30/07 15:50

Message-ID: <8tf7i.19983$j7.373786@news.indigo.ie> from Johny Begood
contained the following:

>Sorry Guys, one of my blonde moments,
>
>How do I generate a crosstab report, or a tabular report or an html table
>that looks like a crosstab report, using PHP?

Usually the output from a query is a number of rows each row being an
array of values. For instance with mysql you might do something like
this

$sql="Select etc etc";
$result=mysql_query($sql);
$result_table="<table>\n<tr>\n";
$result_table.=<th>col1</th><th>col1</th><th>col1</th>\n";
while($myrow=mysql_fetch_assoc($result)){
$result_table.="<tr>\n<td>$myrow[col1]</td><td>$myrow[col2]</td><td>$myrow[col3]</td>\n</tr>\n";
}
$result_table.="</table>";

echo $result_table;
--
Geoff Berrow (put thecat out to email)
It's only Usenet, no one dies.
My opinions, not the committee's, mine.
Simple RFDs http://www.ckdog.co.uk/rfdmaker/

 

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

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