MySQL
テーブルのデータを配置したいのですが(HTML Table)
。すべてがダイナミックです。製品名は必ずしも同じではありません(列)。レコードの数は常に同じ(行) とは限りません。
MySQL テーブル (ROWS データを入力)
iduser idprod quantity date
1234 65 60 2012-11-30 09:13:41.628
1234 66 50 2012-11-30 09:13:41.628
1234 64 80 2012-11-30 09:13:41.628
MySQL テーブル (COLUMNS データを入力)
idprod name date
66 Panettone de Truffas 2012-11-29 15:19:41
65 Panettone de Maracujá 2012-11-29 15:16:56
64 Panettone de Brigadeiro 2012-11-29 15:16:44
コード
$panettones = array();
$querySel = "SELECT * FROM registro_panettone";
$resultSel = mysql_query($querySel);
$rows = mysql_num_rows($resultSel);
$panettones = array();
for($i=0;$i<$rows;$i++) {
/*$panettones["id_user"] = mysql_result($resultSel,$i,0);
$panettones["id_pan"] = mysql_result($resultSel,$i,1);
$panettones["qtd"] = mysql_result($resultSel,$i,2);
$panettones["data"] = mysql_result($resultSel,$i,3);*/
$retorno = mysql_fetch_array($resultSel);
$texto = "<tr>";
$texto .= "<td>".$retorno[0]."</td>";
$texto .= "<td>".$retorno[1]."</td>";
$texto .= "<td>".$retorno[2]."</td></tr>";
echo $texto;
}
現在、次のようになっています。
http://www.cacaushow.net.br/panettone_2012/rel.php
私の願いは、次のようになることです。
http://www.cacaushow.net.br/panettone_2012/wish.php
助言がありますか?