У меня есть этот код для печати таблицы из нескольких столбцов из mysql
$k="<table width='100%' border='0' cellpadding='5'><tr>";
$h=mysql_query("select * from news order by id desc limit 0,12");
$col=0;
while($row=mysql_fetch_assoc($h)){
$col++;
$k .="
<td>
Text here
</td>
";
if($col==3){
$k .="</tr><tr>";
$col=0;
}
}
$k .="</tr></table>";
echo $k;
Я хочу добавить в эту таблицу случайные столбцы, такие как коды Ad-Sense, и хочу, чтобы код Ad-Sense отображался один раз.для каждого столбца.
вывод должен быть таким
<table border="1" width="100%">
<tr>
<td>Title :$row[name]<br>
description : $row[full]</td>
<td>ADV Code1</td>
<td>Title :$row[name]<br>
description : $row[full]</td>
</tr>
<tr>
<td>ADV Code2</td>
<td>Title :$row[name]<br>
description : $row[full]</td>
<td>Title :$row[name]<br>
description : $row[full]</td>
</tr>
<tr>
<td>Title :$row[name]<br>
description : $row[full]</td>
<td>Title :$row[name]<br>
description : $row[full]</td>
<td>ADV Code3</td>
</tr>
<tr>
<td>ADV Code4</td>
<td>Title :$row[name]<br>
description : $row[full]</td>
<td>Title :$row[name]<br>
description : $row[full]</td>
</tr>
</table>
Как мне это сделать?
С уважением