okay. thanks to that error checking code segment i fixed the code and it works. but thats simply one step in my plan.
my original intent is to have the code behave differently based on a switch case... like so..
CODE
function createScroll($x)
{
$xx=$x;
switch($_SESSION[scrtype])
{
case "Non":
$ssq= "INSERT INTO scrolls (name,effect,non,fire,wind,water,earth,description,quantity) VALUES (SESSION[scrname],$_SESSION[scrvalue],1,0,0,0,0,$_SESSION[scrdesc],1)";
$ssres= mysqli_query($xx,$ssq) or die (mysql_error());
break;
case "Fire":
$ssq= "INSERT INTO scrolls (name,effect,non,fire,wind,water,earth,description,quantity) VALUES (SESSION[scrname],$_SESSION[scrvalue],0,1,0,0,0,$_SESSION[scrdesc],1)";
$ssres= mysqli_query($xx,$ssq) or die (mysql_error());
break;
case "Wind":
$ssq= "INSERT INTO scrolls (name,effect,non,fire,wind,water,earth,description,quantity) VALUES (SESSION[scrname],$_SESSION[scrvalue],0,0,1,0,0,$_SESSION[scrdesc],1)";
$ssres= mysqli_query($xx,$ssq) or die (mysql_error());
break;
case "Water":
$ssq= "INSERT INTO scrolls (name,effect,non,fire,wind,water,earth,description,quantity) VALUES (SESSION[scrname],$_SESSION[scrvalue],0,0,0,1,0,$_SESSION[scrdesc],1)";
$ssres= mysqli_query($xx,$ssq) or die (mysql_error());
break;
case "Earth":
$ssq= "INSERT INTO scrolls (name,effect,non,fire,wind,water,earth,description,quantity) VALUES (SESSION[scrname],$_SESSION[scrvalue],0,0,0,0,1,$_SESSION[scrdesc],1)";
$ssres= mysqli_query($xx,$ssq) or die (mysql_error());
break;
}
}
when i fixed the code from yesterday it worked fine . i confirmed inserted data into my DB.
but this code does not work after adding the switch case in.... did i implement it wrong?