Answered
IF statements with form variables
I have a jump box on a page with three values, I want my
record set to change depending on what is selected in the jump box
but so far all I've got is errors. I basically plan on outputting a
table where the column matches the one specified in the form, I
might be doing this completely wrong as I think the IF statement
selects the contents of a column where a match is found but I'm a
little clueless.
Heres the code I'm trying to use. I've been looking into the CASE statement but cant make much sense of it.
IF ("'.$_POST['TASKS']."' = Service) THEN SELECT Service FROM DETAILS
ELSE IF ("'.$_POST['TASKS']."' = Physical) THEN SELECT Physical FROM DETAILS
ELSE ("'.$_POST['TASKS']."' = Skill) THEN SELECT Skill FROM DETAILS
Obviously all my select statements would be different in the final version but at the moment I'm just trying to get it to work.
Thanks
Heres the code I'm trying to use. I've been looking into the CASE statement but cant make much sense of it.
IF ("'.$_POST['TASKS']."' = Service) THEN SELECT Service FROM DETAILS
ELSE IF ("'.$_POST['TASKS']."' = Physical) THEN SELECT Physical FROM DETAILS
ELSE ("'.$_POST['TASKS']."' = Skill) THEN SELECT Skill FROM DETAILS
Obviously all my select statements would be different in the final version but at the moment I'm just trying to get it to work.
Thanks
