I'm trying to connect my website to the MySQL table.
Here is my code;
<?php
$v1 = mysql_query('SELECT * FROM ('.$nompage.') ORDER BY id');
if($v1 === FALSE) {
die('Erreur lors de la selection de la table.'); // TODO: meilleur erreur
}
while($liste = mysql_fetch_array($v1)){
?>
<tr>
<th><?php if(isset($liste['nom'])){
echo $liste["nom"];} ?></th>
<th><a href="<?php echo $liste['lien1']; ?>"><i class="fa fa-external-link"></i>
<?php echo $liste['lien1']; ?></a></th>
<th><?php echo $liste['autre']?></th>
</tr>
<?php
}
?>
The $nompage
fonction is ->
$nompage = htmlspecialchars($_GET["nom"]);
$nompage = mysql_real_escape_string($nompage);
I can see 4 row, because I have 4 items in my tables.
This is the error I get on the second and third column.
Notice: Undefined index: lien1 in C:\xampp\htdocs\show.php on line 102
Notice: Undefined index: autre in C:\xampp\htdocs\show.php on line 103