Advertisement
Guest User

Untitled

a guest
Aug 20th, 2019
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.48 KB | None | 0 0
  1. function User_Ajax()
  2. {
  3. global $DBH;
  4. if (isset($_GET['q'])) {
  5. //$data = array('req' => $_GET['q']);
  6. $RESULT = $DBH->prepare("SELECT * FROM " . DB_PREFIX . "user WHERE `l_name` like '%" . $_GET['q'] . "%' OR `f_name` like '%" . $_GET['q'] . "%'");
  7. $RESULT->execute();
  8. $RESULT->setFetchMode(PDO::FETCH_ASSOC);
  9. while ($row = $RESULT->fetch())
  10. $a[] = $row['f_name'] . ' ' . $row['l_name'];
  11. }
  12. echo json_encode($a);
  13. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement