Hadi1989

Untitled

Jul 10th, 2018
226
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.46 KB | None | 0 0
  1. <?php
  2.     require_once 'conn.php';
  3.    
  4.     if($_POST['txt_name']){
  5.         $name = $_POST['txt_name'];
  6.        
  7.         $conn->query("INSERT INTO `member` VALUES('', '$name')");
  8.        
  9.         $query = $conn->query("SELECT * FROM `member` WHERE `name` = '$name'");
  10.         $fetch = $query->fetch_array();
  11.        
  12.         foreach($_POST['skill'] as $val){
  13.             $skill = addslashes($val);
  14.             $conn->query("INSERT INTO `skill` VALUES('', '$skill', '$fetch[mem_id]')");
  15.         }
  16.        
  17.         echo "Data Inserted";
  18.     }
  19.    
  20.    
  21. ?>
Advertisement
Add Comment
Please, Sign In to add comment