mysql - displaying a single row of data in php using pdo -
<?php if (!empty($_post['modify']) && !empty($_post['input']) && !empty($_post['choose'])) { $val=$_post['modify']; $input=$_post['input']; echo"<table border=6><tr><th>id_etu</th> <th>nom</th><th>prénom</th><th>email</th> <th>mot de passe</th><th>année</th></tr>"; $sql= "select * etudiant '$val'='$input'"; $sth=$conn->query($sql); $res= $sth->fetchall(pdo::fetch_assoc); foreach($res $row){ echo "<tr>"; echo "<td>".$row['id_etu']."</td>"; echo "<td>".$row['nom']."</td>"; echo "<td>".$row['prenom']."</td>"; echo "<td>".$row['email']."</td>"; echo "<td>".$row['motdepasse']."</td>"; echo "<td>".$row['annee']."</td>"; echo "</tr>"; } } ?>
hey everyone, i'm still beginner in php , using pdo statement, , right i'm having trouble displaying single row of data on php page. put more in context. have first form choose field wanna display row input type value of field submit button send form, result should table 1 row, instead entire content of table in database. please.
Comments
Post a Comment