如何将我的搜索结果转换为php中的链接?

时间:2015-05-19 01:06:34

标签: php search hyperlink

我的搜索运行完美但我需要将每个结果链接到描述页面。关于如何做的任何想法?

<?php
session_start();

require_once 'login.php';

$conn = mysqli_connect($server,$user,$password,$dbase);
    if(!$conn){
        die("Failure to connect".mysqli_connect_error());               
    }
    $id = $_SESSION['twitcher'];
    $srch = $_POST['searchstr'];
    $sql = "select * from gallery where title like '%$srch%'";
    $result = mysqli_query($conn,$sql); 

    if(mysqli_num_rows($result) > 0){
       while ($rows=mysqli_fetch_assoc($result)){
            echo $rows['title'].$br.$br;
        }       
    }else echo "No posts found.";
    mysqli_close($conn);        

?>

1 个答案:

答案 0 :(得分:1)

正好为@Dagon stated:您只需回显一个链接标记(array1

<a>