<gras>T_UTIL</gras> UTIL_ID (-> identifiant auto incrémenté) UTIL_LOG UTIL_MDP UTIL_EMAIL
<gras>T_MESS</gras> MESS_ID (-> identifiant du message) MESS_TEXT (-> contenu) UTIL_ID
SELECT T_UTIL.UTIL_LOG,T_MESS.MESS_TEXT from T_UTIL join T_MESS on T_UTIL.UTIL_ID = T_MESS.UTIL_ID where UTIL_ID = 1
SELECT T_UTIL.UTIL_LOG,T_MESS.MESS_TEXT from T_UTIL,T_MESS where T_UTIL.UTIL_ID = T_MESS.UTIL_ID AND UTIL_ID = 1
$table_string; $sql = 'SELECT T_UTIL.UTIL_LOG,T_MESS.MESS_TEXT from T_UTIL,T_MESS where T_UTIL.UTIL_ID = T_MESS.UTIL_ID AND UTIL_ID = 1 ' foreach ($DB->query($sql) as $row) { $table = $table . '<tr><td>' . $row['UTIL_LOG'] . '</td><td>' . $row['MESS_TEXT'] . '</td></tr>' ; } $table = '<table>' . $table . '</table>'; echo $table;
quel logiciel utilisez vous pour programmer en php et MySQL ?Pour dev en PHP Notepad++ suffit emplement.
comment on peut gérer l'affihage avec des tableauxUn exemple ici par exemple :
Select c.* ,u.nom ,u.prenom ,u.pseudo from photo p ,commentaires c ,tbl_users u where c.id_photo = p.id and u.id = c.id_user
peux tu expliquer ou détailler ceci pour la requête
where c.id_photo = p.id and u.id = c.id_user and p.id = '$id_de_ma_photo'
est ce vraiment utile de passer des paramètres ou pasLa réponse est oui.
o,e ,e peut pas faire afficher_comment.php?c.id_photo = p.id andJe n'ai pas compris cette phrase.. désolé.
<?php // // N'oublie pas d'établir la connexion à ta BDD // // récupération de l'ID de la photo passé en GET (isset($_GET[id_photo ]))?$id_Photo=$_GET['id_phot']; if ($id_photo){ // ici la requête SQL si l'id de la photo n'est pas vide $sql = "Select c.* ,u.nom ,u.prenom ,u.pseudo from photo p ,commentaires c ,tbl_users u where c.id_photo = p.id and u.id = c.id_user and p.id = '$id_photo' "; // Ensuite tu executes la requête, puis tu affiche le résultat (dans un tableau par exemple. ) // ... // Le reste de ton code.. // ... ?>
afficher_comment.php?id_photo=10 // 10 étant l'id de la photo DIX.
<?Php //La je met mon code . echo "Bonjour"; ?>