0

i am trying to make my select statement go through my columns which contains multiple values eg "1,2,3" etc. Here is my Select statement

$sql = "SELECT * FROM files where departmentid=".$_SESSION['deptid']."";

$deptids = implode(',', $_POST['deptid']);

As you can see i take in multiple values into the deptid column. Select statement above is meant to show files related to a particular department, which works fine in single values columns but doesn't pick columns that has multiples values.

For instance if "$_SESSION['deptid'] = 4, and a column in table "files" has "2,1,4,5" it doesn't pick it only picks columns with "4". Thank you very much.

0 Answers0