diff options
Diffstat (limited to 'beta_old1/fct_adm.inc.php')
-rw-r--r-- | beta_old1/fct_adm.inc.php | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/beta_old1/fct_adm.inc.php b/beta_old1/fct_adm.inc.php new file mode 100644 index 0000000..1b68b06 --- /dev/null +++ b/beta_old1/fct_adm.inc.php @@ -0,0 +1,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'); + +?>
\ No newline at end of file |