Local_Ghost

search user fix

Aug 21st, 2015
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2. if(isset($_GET['search']))
  3. {
  4.     $user = $_GET['search'];
  5.     $fetch = mysqli_query($conn,"SELECT * FROM users WHERE `UserName` LIKE '%{$user}%'");
  6. ?>
  7.     <div style="float: right; display: inline; padding: 8px 0;">
  8. <?php
  9.     while($row = mysqli_fetch_array($fetch))
  10.     {
  11.         $id = $row['id'];
  12.         $uname = $row['userName'];
  13.         ?>
  14.             <div id="profiles">
  15.                 <a href="profile.php?id=<?=$id?>">
  16.                 <img src="uploads/<?=$id.$uname?>" style="margin-top: 2px; height: 35px; width: 40px;"></img>
  17.                 <?=$uname?>
  18.                 </a>
  19.             </div><br/>
  20.         <?php
  21.     }
  22.     ?>
  23.     </div>
  24. <?php
  25. }
  26. ?>
Advertisement
Add Comment
Please, Sign In to add comment