lol. looks familiar...
haven't tested the below. batteries not included. opening may void warranty. objects in mirror are larger then they may appear. etc. standard disclaimer applies.
<?php
$db = "db_prod";
$table = "test";
mysql_pconnect("localhost",$user_name,$password)
or die("Failed to Connect! Reason: ".mysql_error());
$lang_result = mysql_db_query($db,"SELECT DISTINCT languages FROM $table ORDER B
Y languages ASC");
$id_result = mysql_db_query($db,"SELECT DISTINCT id FROM $table ORDER BY id ASC"
);
echo "<TABLE BORDER=1 CELLPADDING=6 CELLSPACING=2><TR>";
echo "<TH>ID</TH>";
while ($lang_row = mysql_fetch_array ($lang_result))
echo "<TH>",$lang_row["languages"],"</TH>";
echo "</TR>";
while ($id_row = mysql_fetch_array ($id_result))
{
echo "<TR>";
$id = $id_row["id"];
echo "<TD>",$id,"</TD>";
$text_result = mysql_db_query($db,"SELECT languages,text FROM $table where
id = $id ORDER BY languages ASC");
mysql_data_seek($lang_result,0);
$text_row = mysql_fetch_array ($text_result);
while ($lang_row = mysql_fetch_array($lang_result))
{
if(!strcasecmp($lang_row["languages"], $text_row["languages"]))
{
echo "<TD>",$text_row["text"],"</TD>";
$text_row = mysql_fetch_array ($text_result);
}
else
echo "<TD> </TD>";
}
echo "</TR>";
}
echo "</TABLE>";
?>