Advertisement
apl-mhd

Multiple Check Box Select

Aug 8th, 2018
142
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.35 KB | None | 0 0
  1. $jobArray =  $_GET['job'];  //checkbox
  2.  
  3.  
  4. foreach ($jobArray as  $key => $val) // convert to arry
  5.     $arr2[$key] = $val;
  6.  
  7. $in = join("','", $arr2); // join array
  8.  
  9.  
  10. $con =  new  mysqli($serverName,$uName,$pass,$dbName);
  11.  
  12. if($con->connect_error)
  13.     die("aaa".$con->connect_error);
  14.  
  15.  
  16. $sql  = "SELECT * FROM employees where  job_id in('$in')";
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement