bonjour tout le monde
je reviens une fois de plus vous solliciter pour un peu d'aide sur cette erreur:
ma page functions_adm_htm.phpWarning: Invalid argument supplied for foreach() in C:\wamp\www\vrai\panneau\includes_adm\functions_adm_htm.php on line 22
Ma page functions_mysql.php
Code : Sélectionner tout - Visualiser dans une fenêtre à part
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
34
35
36
37
38
39
40
41 <?php } function htm_categorie(){ global $language_adm, $result; ?> <div id="page-wrapper" class="page-wrapper-cls"> <div id="page-inner"> <h2><?php echo $language_adm['categorie']; ?></h2> <?php // var_dump(categorie()); ?> <table class="table table-striped"> <thead> <th>Id</th> <th>Nom</th> <th>action</th> </thead> <tbody> <?php foreach($result as $k): ?> <tr> <td><?php echo $k['id']; ?></td> <td><?php echo $k['nom']; ?> </td> <td><?php echo 'bonjour' ?></td> </tr> <?php endforeach; ?> </tbody> </table> </div> </div> <?php } ?>
ma page all_functions_adm.php (elle fait les inclusions)
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10 function categorie(){ global $bdd; $bdd = db_connect(); $sql = "SELECT id, nom, slug FROM categories"; $req = $bdd->prepare($sql); $req->execute(); $result = $req->fetchAll(); return $result; }
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5 <?php require_once('language/language_adm.php'); require_once('functions_data.php'); require_once('functions_adm_htm.php'); require_once('functions_adm_mysql.php');
Partager