php - How to access to the individual results when I get all results from search query -


could please me how access individual results fetched in array mysql database? running code below, results satisfy search criteria results without blank space in 1 array, example $username variable collects usernames in 1 line without spaces satisfy specific search criteria. how can split these results in individual results? tried string functions not work. thank in advance!

$sqlcommand = "(select * users country '%$searchquery%' or city '%$searchquery%' or town '%$searchquery%')"; $query = mysqli_query($cn, $sqlcommand) or die(mysqli_error($cn));         $count = mysqli_num_rows($query);         if($count > 1){             $search_output .= "<hr />$count results <strong>$searchquery</strong><hr />$sqlcommand<hr />";             while($row = mysqli_fetch_array($query, mysqli_assoc)){                     $url = $row["url"];                     $url.=' &nbsp ';                     $url1 = strtok($url," ");                     $id = $row["id"];                 $f_name = $row["f_name"];                  $l_name = $row["l_name"];                  $user = $f_name;                  $user.= "&nbsp;";                  $user.= $l_name;                  $username = $row["username"];                   $username.=' <br>';                 // nl2br( $url, true);                   $search_output .= '<a href="user.php?u=$username">'. $user . ' </a><br />';                 } 


Comments

Popular posts from this blog

apache - Remove .php and add trailing slash in url using htaccess not loading css -

javascript - jQuery show full size image on click -