i am trying to create a registration form and i have a column where i want to insert multiple values in that single column(catagory) through check Box. is there a possible way to do that? have a look at my php files.
Thank You,
This is my Dboperation.php
And this is my main registration.php file
Any help will be appreciated.
Thank You,
This is my Dboperation.php
PHP Code
<?php
public function createEmpl($name, $surname, $username, $user_pass, $address, $pin, $mail, $phone, $catagory){
if($this->isUserExist($username,$mail,$phone)){
return 0;
}else{
$password = md5($user_pass);
$stmt = $this->con->prepare("INSERT INTO `employee_data` (`name`, `surname`, `username`, `password`, `address`, `pin`, `mail`, `phone`, `catagory`) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?);");
$stmt->bind_Param("sssssssss",$name,$surname,$username,$password,$address,$pin,$mail,$phone,$catagory);
if($stmt->execute()){
return 1;
}else{
return 2;
}
}
}
And this is my main registration.php file
PHP Code
<?php
if(
isset($_POST['reg_name']) and isset($_POST['reg_surname']) and isset($_POST['reg_username']) and isset($_POST['reg_password']) and isset($_POST['reg_address']) and isset($_POST['reg_pin']) and isset($_POST['reg_mail']) and isset($_POST['reg_phone']) and isset($_POST['reg_catagory'])
){
//operate the data further
$db = new DbOperations();
$result = $db->createEmpl( $_POST['reg_name'],
$_POST['reg_surname'],
$_POST['reg_username'],
$_POST['reg_password'],
$_POST['reg_address'],
$_POST['reg_pin'],
$_POST['reg_mail'],
$_POST['reg_phone'],
$_POST['reg_catagory']
);
if($result == 1){
$response['error'] = false;
$response['message'] = "User register successfully";
Any help will be appreciated.

