Guest User

Untitled

a guest
Jun 22nd, 2018
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.72 KB | None | 0 0
  1. call_user_func_array(array(&$stmt, 'bindparams'), $array_of_params);
  2.  
  3. array(&$stmt, 'bindparams')
  4.  
  5. call_user_func_array(array(&$stmt, 'bindparams'), $array_of_params);
  6.  
  7. $stmt->bind_params($array_of_params[0], $array_of_params[1] ... $array_of_params[N])
  8.  
  9. select * from mytable
  10. where status = ? and (userid = ? or ?)
  11. and (location = ? or ?)
  12. order by `date` desc, time desc
  13. limt ?
  14.  
  15. $stmt = $mysqli->prepare( [statement above] );
  16. $stmt->bind_param( "siiiii",
  17. "active", $userid, $userid == "ALL",
  18. $location, $location == "ALL",
  19. $limit);
  20.  
  21. $userIdEmpty = $userid == "ALL";
  22. $locationEmpty = $location = "ALL";
  23. $stmt->bind_param( "siiiii",
  24. "active", $userid, $userIdEmpty,
  25. $location, $locationEmpty,
  26. $limit);
Add Comment
Please, Sign In to add comment