Hello.I have problem please help me. Thank you in advanced.

I have radio button in my form. The data will be insert into MySQL based on the selected radio button. For example, I have A and B table. The radio button value also A and B. If I select A, the data will be insert into table A. If I select B, the data will be insert into table B.

Please help me asap.

try this:

<?php
    $rdobutton = $_POST['select'];
    $sql = "INSERT INTO tbl_name (`radiobutton`) VALUES('$rdobutton')";
    mysql_query($sql);

?>

<form method="POST">
  <input type="radio" name="select" value="a">A<br>
  <input type="radio" name="select" value="b">B<br>
</forms>

hope this helps

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.