Advertisement
Guest User

Untitled

a guest
Mar 18th, 2018
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.37 KB | None | 0 0
  1. function update($table,$arr,$arr0){
  2. $stm="";
  3. foreach ($arr as $key => $value) {
  4. $stm.= " $key = '$value' and";
  5. }
  6. $stm = substr($stm,0,-3);
  7.  
  8. $stm0="";
  9. foreach ($arr0 as $key => $value) {
  10. $stm0.=" $key = '$value' and";
  11.  
  12. }
  13. $stm0 = substr($stm0,0,-3);
  14. return $this->conn->query("UPDATE $table set $stm WHERE $stm0");
  15. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement