ronaldinho_880
Registered
Как да направя, така че при изкарване на информация от SQL в html таблица да не се създават нови таблици, а записите да влизат само в една.
PHP:
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<style type="text/css" media="all">
@page {
size: landscape;
margin-top: 0;
margin-bottom: 1cm;
margin-left: 0;
margin-right: 0;
}
table {
border: .02em solid #666; border-collapse:collapse;
width:100%;
}
td, th {
border: .02em solid #666; font-size:12px; line-height: 12px;
vertical-align:middle; padding:5px; font-family:"Arial";
}
th { text-align:left; font-size:12px; font-weight:bold; }
h2 { margin-bottom: 0; }
</style>
</head>
<?php
error_reporting(E_ERROR | E_WARNING | E_PARSE);
include "config.php";
echo "<center>";
echo "<a href='dobavi.php'>Добави прогноза<a/>";
$sql = "SELECT * FROM `match` order by id ";
$result = mysql_query($sql) or die (mysql_error());
while ($date = mysql_fetch_assoc($result)) {
$seetext = substr($date['text'],0,10);
$id = $_GET['id'];
echo "
<table style='border: 0px solid black;'>
<thead >
<tr>
<th>Час</th>
<th>Мач</th>
<th>Първенство</th>
<th>1</th>
<th>X</th>
<th>2</th>
</tr>
</thead>
<tr>
<td>$date[time]</td>
<td>$date[match]</td>
<td>$date[purvenstvo]</td>
<td>$date[odd1]</td>
<td>$date[oddx]</td>
<td>$date[odd2]</td>
</tr>
</table>
";
}
?>