0
<?php
require 'db.php';
include_once("header.php");
include_once("functions.php");


if(isset($_POST['search_term'])){
    $search_term = mysql_real_escape_string(htmlentities ($_POST['search_term']));

    if(!empty($search_term)){

        $search = mysql_query("SELECT users.username, users.id, tbl_image.photo, tbl_image.userid FROM users LEFT OUTER JOIN tbl_image ON users.id=tbl_image.userid WHERE users.username LIKE '%$search_term%' and users.business <> 'business'");


        $result_count = mysql_num_rows($search);



        $suffix = ($result_count != 1) ? 's' : '';


        echo '<div data-theme="a">Your search for <strong>' , $search_term ,'</strong> returned <strong>', $result_count,' </strong> record', $suffix, '</div>';



        while($results_row = mysql_fetch_assoc($search)){
            echo '<div data-theme="a"><strong>',$results_row['photo'], $results_row['username'],  '</strong></div>';



$following = following($_SESSION['userid']);


    if (in_array($key,$following)){
        echo ' <div action= "action.php" method="GET" data-theme="a">
        <input type="hidden" name="id" value="$key"/>
        <input type="submit" name="do" value="follow" data-theme="a"/>
</div>';

    }else{
        echo " <div action='action.php' method='GET' data-theme='a'>
        <input type='hidden' name='id' value='$key'/>
        <input type='submit' name='do' value='follow' data-theme='a'/>
        </div>";

}

}

        }

}

?>

我如何获得在页面上显示的实际图像而不是图像的名称。我在文件系统中有一个名为 image 的文件夹下的图像。我如何在屏幕上回显该图像,或者如果回显不是正确的方法,您将如何做?

4

1 回答 1

1

你的意思是这样吗?

echo '<img src="'.$results_row['photo'].'" width="80">';
于 2012-07-10T02:39:43.493 回答