Hi i have a multiple if else statement which enters the first line of information but that is it. The script doesn’t error or anything it just deosn’t enter the information. I have tested all the variables and the information is passed to this page correctly and if i echo the individual variables the correct information is displayed.
Below is the statements.
[code=php]
if (isset($model)) {
mysql_query(“INSERT INTO products (Product_Code, Product_Name, Price, Qty, Total, Order_Number) VALUES(‘$model’, ‘$name’, ‘$price’, ‘$qty’, ‘$total’, ‘$non’) “)
or die(mysql_error());
}
elseif (isset($model1)) {
mysql_query(“INSERT INTO products (Product_Code, Product_Name, Price, Qty, Total, Order_Number) VALUES(‘$model’, ‘$name’, ‘$price’, ‘$qty’, ‘$total’, ‘$non’) “)
or die(mysql_error());
}
elseif (isset($model2)) {
mysql_query(“INSERT INTO products (Product_Code, Product_Name, Price, Qty, Total, Order_Number) VALUES(‘$model2’, ‘$name2’, ‘$price2’, ‘$qty2’, ‘$total2’, ‘$non’) “)
or die(mysql_error());
}
elseif (isset($model3)) {
mysql_query(“INSERT INTO products (Product_Code, Product_Name, Price, Qty, Total, Order_Number) VALUES(‘$model3’, ‘$name3’, ‘$price3’, ‘$qty3’, ‘$total3’, ‘$non’) “)
or die(mysql_error());
}
elseif (isset($model4)) {
mysql_query(“INSERT INTO products (Product_Code, Product_Name, Price, Qty, Total, Order_Number) VALUES(‘$model4’, ‘$name4’, ‘$price4’, ‘$qty4’, ‘$total4’, ‘$non’) “)
or die(mysql_error());
}
elseif (isset($model5)) {
mysql_query(“INSERT INTO products (Product_Code, Product_Name, Price, Qty, Total, Order_Number) VALUES(‘$model5’, ‘$name5’, ‘$price5’, ‘$qty5’, ‘$total5’, ‘$non’) “)
or die(mysql_error());
}
elseif (isset($model6)) {
mysql_query(“INSERT INTO products (Product_Code, Product_Name, Price, Qty, Total, Order_Number) VALUES(‘$model6’, ‘$name6’, ‘$price6’, ‘$qty6’, ‘$total6’, ‘$non’) “)
or die(mysql_error());
}
elseif (isset($model7)) {
mysql_query(“INSERT INTO products (Product_Code, Product_Name, Price, Qty, Total, Order_Number) VALUES(‘$model7’, ‘$name7’, ‘$price7’, ‘$qty7’, ‘$total7’, ‘$non’) “)
or die(mysql_error());
}
elseif (isset($model8)) {
mysql_query(“INSERT INTO products (Product_Code, Product_Name, Price, Qty, Total, Order_Number) VALUES(‘$model7’, ‘$name7’, ‘$price7’, ‘$qty7’, ‘$total6’, ‘$non’) “)
or die(mysql_error());
}
elseif (isset($model8)) {
mysql_query(“INSERT INTO products (Product_Code, Product_Name, Price, Qty, Total, Order_Number) VALUES(‘$model8’, ‘$name8’, ‘$price8’, ‘$qty8’, ‘$total8’, ‘$non’) “)
or die(mysql_error());
}
elseif (isset($model9)) {
mysql_query(“INSERT INTO products (Product_Code, Product_Name, Price, Qty, Total, Order_Number) VALUES(‘$model9’, ‘$name9’, ‘$price9’, ‘$qty9’, ‘$total9’, ‘$non’) “)
or die(mysql_error());
}
elseif (isset($model10)) {
mysql_query(“INSERT INTO products (Product_Code, Product_Name, Price, Qty, Total, Order_Number) VALUES(‘$model10’, ‘$name10’, ‘$price10’, ‘$qty’10, ‘$total10’, ‘$non’) “)
or die(mysql_error());
}
elseif (isset($model11)) {
mysql_query(“INSERT INTO products (Product_Code, Product_Name, Price, Qty, Total, Order_Number) VALUES(‘$model11’, ‘$name11’, ‘$price101’, ‘$qty11’, ‘$total11’, ‘$non’) “)
or die(mysql_error());
}
elseif (isset($model12)) {
mysql_query(“INSERT INTO products (Product_Code, Product_Name, Price, Qty, Total, Order_Number) VALUES(‘$model12’, ‘$name112’, ‘$price112’, ‘$qty112’, ‘$total12’, ‘$non’) “)
or die(mysql_error());
}
elseif (isset($model13)) {
mysql_query(“INSERT INTO products (Product_Code, Product_Name, Price, Qty, Total, Order_Number) VALUES(‘$model13’, ‘$name13’, ‘$price13’, ‘$qty13’, ‘$total13’, ‘$non’) “)
or die(mysql_error());
}
elseif (isset($model14)) {
mysql_query(“INSERT INTO products (Product_Code, Product_Name, Price, Qty, Total, Order_Number) VALUES(‘$model14’, ‘$name14’, ‘$price14’, ‘$qty14’, ‘$total14’, ‘$non’) “)
or die(mysql_error());
}
elseif (isset($model15)) {
mysql_query(“INSERT INTO products (Product_Code, Product_Name, Price, Qty, Total, Order_Number) VALUES(‘$model15’, ‘$name15’, ‘$price15’, ‘$qty15’, ‘$total15’, ‘$non’) “)
or die(mysql_error());
}