blob: 1b68b0635116cb9d4b8b633fd921132855ae8839 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
|
<?php
function html_generate_MySQLTable($table, $columns='*', $where_clause='', $row_begin='', $row_end='')
{
require_once('app/include/ludo/html_elements.inc.php');
require_once('app/include/connect.inc.php');
if ( $where_clause !== '' ) { $where_clause="WHERE $where_clause"; }
$query = "SELECT $columns FROM $table $where_clause;";
echo "DEBUG : $query\n";
if ( ! $result = @mysql_query($query) )
{
return "Erreur de g�n�ration de la table $table\n";
}
else
{
$row = mysql_fetch_assoc($result);
// Affichage des ent�tes du tableau
echo "<table>\n<thead>\n<tr>\n";
echo "$row_begin<td>" . implode("</td>\n<td>",array_keys($row)) . "</td>$row_end\n";
echo "</tr>\n</thead>\n<tbody>\n";
do
{
echo "<tr>\n\t<td>" . implode("</td>\n<td>",$row) . "</td>\n</tr>\n";
} while ( $row = mysql_fetch_assoc($result) );
echo "</tbody>\n</table>\n";
}
}
html_generate_MySQLTableSuppr('AWOR_Reunion','idR');
?>
|