How to delete mysql when check radio button using ajax ?
after i checked radio button SECOND RADIO
i want to delete mysql like this
$sql = "DELETE FROM procust_store_1 WHERE products_id = '$_POST[products_id]' AND user = '$id' "; $objQuery = mysql_query($sql);
and if checked radio button FIRST RADIO
i want to delete mysql like this
$sql = "DELETE FROM procust_store_2 WHERE products_id = '$_POST[products_id]' AND user = '$id' "; $objQuery = mysql_query($sql);
....
How can i do that ?
<script type="text/javascript" src="http://code.jquery.com/jquery.min.js"></script>
<script>
$(document).ready(function(){
$(".radio_id").click(function(){
if($(this).attr("value")=="first"){
$("#second_checkbox").hide();
$("#first_checkbox_display").show();
}
if($(this).attr("value")=="second"){
$("#first_checkbox_display").hide();
$("#second_checkbox").show();
}
});
});
</script>
<form id="first_checkbox_display" name="form1" method="post" action="" ENCTYPE = "multipart/form-data" onsubmit="return checkform(this);" style=" margin: 0px; " >
<input type="text" name="products_id" value="1294759">
<input type="text" name="products_color" value="red">
<input type="text" name="products_type" value="electronic">
<input type="button" value="Check1" onclick="doajax_products_check()"/>
<p id="myplace_data1"></p>
</form>
<form id="second_checkbox" name="form2" method="post" action="" ENCTYPE = "multipart/form-data" onsubmit="return checkform(this);" style=" display: none; margin: 0px; " >
<input type="text" name="products_id" value="0000000">
<input type="text" name="products_color" value="iiiiiii">
<input type="text" name="products_type" value="aaaaaaa">
<input type="button" value="Check2" onclick="doajax_products_check2()"/>
<p id="myplace_data2"></p>
</form>
<label><input type="radio" class="radio_id" name="colorRadio" value="first" checked >FIRST RADIO</label>
<br>
<label><input type="radio" class="radio_id" name="colorRadio" value="second">SECOND RADIO</label>