Hello,
I've got a html form that queries a mysql database. Apart from the text boxes in this form, I have got 6 radio buttons. Therefore, when processing this form, I am using a switch like the code below.
Now I want to add 2 check boxes in this form. How do I modify my switch code in the shortest & most elegant manner?
Thank you very much for your advice.
My code is below:-
switch($_POST['category'])
{
case 'one':
$query1=("INSERT INTO table_1(keyword, sale, agents, email, expiry) VALUES ('$Text_Box_17','$status','$enum','$Text_Box_26','$onemonth')");
break;
case 'two':
$query1=("INSERT INTO table_2(keyword, sale, agents, email, expiry) VALUES ('$Text_Box_17','$status','$enum','$Text_Box_26','$onemonth')");
break;
case 'three':
$query1=("INSERT INTO table_3(keyword, sale, agents, email, expiry) VALUES ('$Text_Box_17','$status','$enum','$Text_Box_26','$onemonth')");
break;
case 'four':
$query1=("INSERT INTO table_4(keyword, sale, agents, email, expiry) VALUES ('$Text_Box_17','$status','$enum','$Text_Box_26','$onemonth')");
break;
case 'five':
$query1=("INSERT INTO table_5(keyword, sale, agents, email, expiry) VALUES ('$Text_Box_17','$status','$enum','$Text_Box_26','$onemonth')");
break;
case 'six':
$query1=("INSERT INTO table_6(keyword, sale, agents, email, expiry) VALUES ('$Text_Box_17','$status','$enum','$Text_Box_26','$onemonth')");
break;
}