<?php
require 'db.php';
include_once("header.php");
include_once("functions.php");
include_once("profile.php");
if(isset($_POST['search_term'])){
$search_term = mysql_real_escape_string(htmlentities ($_POST['search_term']));
if(!empty($search_term)){
$search = mysql_query("SELECT `username`,`id` FROM `users` WHERE `username` LIKE '%$search_term%' and `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>', "<img src='/image/<?php echo $image; ?>' width= 50px height=50px>", $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>";
}
}
}
}
?>
我需要一些帮助,将用户图像放入此代码的回显部分。我不确定如何做到这一点,以便将图像放在正确的搜索行上。任何建议将不胜感激。下面是我所指的代码行。谢谢。
而($results_row = mysql_fetch_assoc($search)){
echo ' ', "' width= 50px height=50px>", $results_row['username'], ' ';