Search code examples
phphtmlhref

Undefined href in a html table


I've got a problem with a html table in a php code. I try this code but I have a problem with href in a tag. In fact when I click on the href it post undefined while DetailsAnnonces.php exist.

Thanks for your response.

<?php 

            $conn=@mysqli_connect($_SESSION['servername'],$_SESSION['username'],
                $_SESSION['password'], $_SESSION['database']) or die(mysql_error());
                $verifExistence1 = "SELECT * FROM `annonces`;";
                $result = mysqli_query($conn, $verifExistence1);

                echo "<table border = 2>";
                echo "<table  align='center'>   <thead>
                                <tr>
                                    <th>Titre</th>
                                    <th>Description</th>
                                    <th>Image</th>
                                </tr>
                            </thead>
                            <tbody>";
                while($row =  @mysqli_fetch_assoc($result)){
                $idbis=$row['id'];
                $titrebis=$row['titre'];
                echo "<tr>
                <td>" . $row['titre'] . "</td><td>" . $row['description'] . "</td>
                <td> <a   href=\"DetailsAnnonces.php?id=$idbis\">$titrebis</a>
                </tr>";

                }
                echo "</table>";
                //echo $html_table;
                ?>

Solution

  • The problem was caused by a javascript left on this page.