0

hi i am tring to insert one table data to another using checkbox my flow is people check in checkbox and submit checkbox value will be pass in the query and insert data into another table my code is:

<form action="form.php" method="post">
<input type="checkbox" name="chk1[]" value="701" />
i am agree
<input type="checkbox" name="chk1[]" value="702" />swapan sen
<input type="checkbox" name="chk1[]" value="Babli sen" /> Babli Sen <br />
<input type="submit" name="submit" value="submit" />
</form>
</body>
</html>
<?php
include("config.php");
$checkbox1=$_POST['chk1'];
if ($_POST["submit"]=="submit")

$query="INSERT INTO table2 (player_id,player_name,player_url) SELECT player_id,player_name,player_url FROM table1 WHERE player_id = ('".$checkbox1."')";
mysql_query($query) or die (mysql_error()); 
echo "Record is inserted";  
}
?>

i can get messege "record is inserted" but in database i don't get any data somebody plz help thank in advance

2
Contributors
2
Replies
8
Views
3 Years
Discussion Span
Last Post by santunu23
0

thanks now able to insert data into database thank you very much for response .

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.