I am trying to set up a form in PHP to take membership details.
Each member belongs to one of 10 classes and the classes fall into one of 4 types. What I want to do is to take the $class input and supply the $type input using a statement such as
If $class = 'a' or 'b' or 'c' then $type = 'x' else if $class = 'd' or 'e' or 'f' then $type = 'y' ... etc
I have even tried doing it with a single if statement (below) just to test whether it could work
$sql = "INSERT INTO main (Field1, Field2, Field3, Field4, Field5) VALUES ('$field1','$field2','$field3','$field4', '$field5')";
if ($field2 = "a") {
($field5 = "x"); }
$result = mysql_query($sql);
The VALUES coming from a html form
But this returns the following error:
Notice: Undefined variable: field5 in C:\Program Files\Apache Group\Apache2\htdocs\form.php on line 22
line 22 being ($field5 = "x"); }
I haven't defined any of the other variables elsewhere in the code.
I hope this makes sense, as I have been smacking my head against a wall all day over this
Thanks
Isle
And ideas, or is there an easier way to do this.
Thanks
Isle