Title: PHP: Multiple select statements - HTML Forms and MySQL Post by: Hellraiser on August 29, 2007, 10:53:13 AM Multiple select statements - HTML Forms and MySQL
Lets cut to the chase, how would you pass values from one form to the other using a list with multiple choices? The answer is by adding a square bracket in the name of the select statement Example: Code: <form name="myform" method="post" action="send.php"> My boyfriend is my "life", he is "caring" but "heartless" at times, so I select those three options Now on the send.php page to extract the values of "boyfriend" select statement do the following: Code: $boyfriend=$_POST["boyfriend"]; Now if you want to store the value in a MySQL table use a simple insert statement: Code: mysql_query("insert into tablename values ('$string')"); |