Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to insert checkbox valuse to mysql

Status
Not open for further replies.

keith23

Technical User
May 26, 2005
97
NL
Hi all i got a form with a few checkbox on it. User select a few of checkboxes and and press a button to write their values to db. But i do not know how to write it to mysql db. I be happy if an expert help me with that.Thanks


code for check box form

Code:
<form action="./write.php" method=post >

<input type="checkbox" name="id" value="1"
<input type="checkbox" name="id" value="2"
<input type="checkbox" name="id" value="3"

<input type="submit" value="Add this/these Songs to my PlayList" name="B1">
 
Your script looks for a value in $_POST['id']. It then includes that value in the creation of either an update or insert query as appropriate. It then will pass the query to your database server.



Want the best answers? Ask the best questions! TANSTAAFL!
 
Many thanks for u reply.well the problem is i do not know how to grab those values and run insert statment for each one of them. So i be happy if u sho me how to grab passed values and run insert for each one of them.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top