I have a folder structure and two folders are named up as ComputerScience and Science
The trouble is my code always detects the variable as containing science when i need to match them both.
Im using
if (strpos($dir, "ComputerScience") !== FALSE) {
$my_full_path= $dir;
$sql = "UPDATE documents
SET subject = 'ComputerScience'
WHERE documentname='".$dir."'";
mysqli_query($link,$sql);
}
and
if (strpos($dir, "Science") !== FALSE) {
$my_full_path= $dir;
$sql = "UPDATE documents
SET subject = 'Science'
WHERE documentname='".$dir."'";
mysqli_query($link,$sql);
}
Im guessing the second block of code is overwriting the first with being matched, how can i do an exact match of the string if $dir variable contains it?
Thanks