Advertisement
Guest User

Untitled

a guest
Apr 19th, 2016
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.44 KB | None | 0 0
  1. function selectQuery($query,$user_input=array()){
  2.  
  3. $s='';
  4. if(count($user_input)>0){
  5. foreach( $user_input as $input ){
  6. $s.='s';
  7. }
  8. }
  9. $select=$this->mysqli->prepare($query);
  10. $select->bind_param($s,$user_input); //this is the line where the array is going in and apparently is not possible.
  11. $select->execute();
  12. }
  13. $query='SELECT * FROM users where username=?';
  14. $user_input=array('test');
  15. $test->selectQuery($query,$user_input);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement