I am novice PHP programmer and I have created a function that changes an SQL command. Here is relevant piece of code:
$extra_text_length = strlen($_GET[extra_text]);
$boolean = $_GET['first-boolean'];
function check_boolean(){
if($extra_text_length > 0){
if($boolean=="and"){
$query .= " AND (software.SWID='$_GET[extra_text]')";
} elseif($boolean=="or"){
$query .= " OR (software.SWID='$_GET[extra_text]')";
} elseif($boolean=="not"){
$query .= " NOT IN (software.SWID='$_GET[extra_text]')";
}
} return $boolean;
}
check_boolean();
The problem is that it doesn't do what it should do. If I remove the code from the function however and as consequence I remove the check_boolean() method it works perfectly. Would anyone give me a hint? Thanks in advance