Guest User

Untitled

a guest
Feb 23rd, 2018
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.87 KB | None | 0 0
  1. Array ( [api] => 1 [id] => Array ( [0] => 1 [1] => 2 [2] => 3 [3] => 4 [4] => 5 [5] => 6 [6] => 7 [7] => 8 [8] => 9 [9] => 10 ) [code] => Array ( [0] => mobile [1] => dth [2] => postpaid [3] => landline [4] => billpayment [5] => billpayment [6] => billpayment [7] => billpayment [8] => billpayment [9] => billpayment ) )
  2.  
  3. function insertOperatorType($api,&$operator_id,&$code){
  4. global $mysqli;
  5. $stmt = $mysqli->prepare('INSERT INTO pd_operator_type(
  6. api_id,
  7. operator_id,
  8. code
  9. ) VALUES (
  10. ?,
  11. ?,
  12. ?
  13. )');
  14. $stmt->bind_param('sss',$api,$operator_id,$code);
  15. $stmt->execute();
  16. $inserted_id = $mysqli->insert_id;
  17. if($inserted_id > 0){
  18. return $inserted_id;
  19. } else {
  20. return "";
  21. }
  22. }
  23.  
  24. for($i = 0; $i < COUNT($operator_id); $i++){
  25. insertOperatorType($api,$operator_id[$i],$code[$i]);
  26. }
Add Comment
Please, Sign In to add comment