• User

    Rendere dati di una tabella mysql link

    Ciao a tutti, sto creando per il mio sito un motore di ricerca che ricerchi i miei articoli tutorial... Ho già creato il mio database e la mia searchbar, tutto funziona come dovrebbe ma mi manca di implementare la funzione del "far diventare link" i dati che vengono fuori come output dopo della ricerca, solamente che non so dove mettere le mani; mi potreste molto gentilmente aiutare? Grazie mille...
    Vi lascio i link della searchbar e il codice
    link= https://hard-questions.com/try/ggg.php
    [PHP]<!DOCTYPE html><html><head> <title>Search Bar using PHP</title></head><body>
    <form method="post"><label>Search</label><input type="text" name="search"><input type="submit" name="submit"> </form>
    </body></html>
    <?php
    $con = new PDO("mysql:host=sql300.epizy.com;dbname=epiz_24872058_hardquestions",'epiz_24872058','yLzTqP0MzhWpmNs');

    if (isset($_POST["submit"])) { $str = $_POST["search"]; $sth = $con->prepare("SELECT * FROM search WHERE Name = '$str'");
    $sth->setFetchMode(PDO:: FETCH_OBJ); $sth -> execute();
    if($row = $sth->fetch()) { ?> <br><br><br> <table> <tr> <th>Name</th> <th>Description</th> </tr> <tr> <td><?php echo $row->Name; ?></td> <td><?php echo $row->Description;?></td> </tr>
    </table><?php } else{ echo "Name Does not exist"; }

    }
    ?>[/PHP]