Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to show this image?
    text
    copied!<pre><code>&lt;?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` &lt;&gt; 'business'"); $result_count = mysql_num_rows($search); $suffix = ($result_count != 1) ? 's' : ''; echo '&lt;div data-theme="a"&gt;Your search for &lt;strong&gt;' , $search_term ,'&lt;/strong&gt; returned &lt;strong&gt;', $result_count,' &lt;/strong&gt; record', $suffix, '&lt;/div&gt;'; while($results_row = mysql_fetch_assoc($search)){ echo '&lt;div data-theme="a"&gt;&lt;strong&gt;', "&lt;img src='/image/&lt;?php echo $image; ?&gt;' width= 50px height=50px&gt;", $results_row['username'], '&lt;/strong&gt;&lt;/div&gt;'; $following = following($_SESSION['userid']); if (in_array($key,$following)){ echo ' &lt;div action= "action.php" method="GET" data-theme="a"&gt; &lt;input type="hidden" name="id" value="$key"/&gt; &lt;input type="submit" name="do" value="follow" data-theme="a"/&gt; &lt;/div&gt;'; }else{ echo " &lt;div action='action.php' method='GET' data-theme='a'&gt; &lt;input type='hidden' name='id' value='$key'/&gt; &lt;input type='submit' name='do' value='follow' data-theme='a'/&gt; &lt;/div&gt;"; } } } } ?&gt; </code></pre> <p>I would like some help putting the user image into the echo section of this code. I am not exactly sure how to do this so that it puts the image on the correct line of the search. Any advice would be greatly appreciated. Below is the line of code that I am referring too. Thanks.</p> <blockquote> <p>while($results_row = mysql_fetch_assoc($search)) {</p> <p>echo '<strong>', "' width= 50px height=50px>", $results_row['username'], '</strong>';</p> </blockquote>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload