xxreenaxx1 Posted February 14, 2011 Share Posted February 14, 2011 I am echo information from the database now I would like to insert these to different table. I am using checkbox to echo and when the user click on the one of these the result should be saved to a new table. So far I have <?php include 'Database/connection.php'; include 'Database/question_sql.php'; while($info = mysql_fetch_array( $sql )) { echo "{$info['Que_Question']} <br />\n"; echo "<input type=\"checkbox\" name=\"choice1[]\" value=\"{$info['Que_Choice1']}\" /> "; echo "{$info['Que_Choice1']} <br />\n"; echo "<input type=\"checkbox\" name=\"choice2[]\" value=\"{$info['Que_Choice2']}\" /> "; echo "{$info['Que_Choice2']} <br />\n"; echo "<input type=\"checkbox\" name=\"choice3[]\" value=\"{$info['Que_Choice3']}\" /> "; echo "{$info['Que_Choice3']} <br />\n"; echo "<input type=\"checkbox\" name=\"choice4[]\" value=\"{$info['Que_Choice4']}\" /> "; echo "{$info['Que_Choice4']} <br />\n"; } ?> Quote Link to comment Share on other sites More sharing options...
zenlord Posted February 14, 2011 Share Posted February 14, 2011 Those 'inputs' that you echo should be part of a new <form method="post" action=""> with action set to the php-script to handle the POST-vars and insert them into a table. Quote Link to comment Share on other sites More sharing options...
xxreenaxx1 Posted February 14, 2011 Author Share Posted February 14, 2011 but I am getting these echo's from another table. Can I do that? Quote Link to comment Share on other sites More sharing options...
zenlord Posted February 15, 2011 Share Posted February 15, 2011 of course. Just try it out and you'll see. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.