Andrew R Posted February 11, 2009 Share Posted February 11, 2009 I have the following form array..... <form id="form1" name="form1" method="post" action="post.php"> <label> <input name="user_id[]" type="checkbox" id="user_id[]" value="1" /> </label> Andrew<br /> <label> <input name="user_id[]" type="checkbox" id="user_id[]" value="2" /> </label> Jim<br /> <label> <input name="user_id[]" type="checkbox" id="user_id[]" value="3" /> </label> James </form> How would I combine user_id[] into 1 variable which would contain the values separated by a comma so it could be passed into a sql statement. Many thanks Quote Link to comment https://forums.phpfreaks.com/topic/144776-solved-form-array-help/ Share on other sites More sharing options...
killah Posted February 11, 2009 Share Posted February 11, 2009 $ids = implode(',', $_POST['user_id']); Quote Link to comment https://forums.phpfreaks.com/topic/144776-solved-form-array-help/#findComment-759679 Share on other sites More sharing options...
Andrew R Posted February 11, 2009 Author Share Posted February 11, 2009 As easy as that Thanks very much! Quote Link to comment https://forums.phpfreaks.com/topic/144776-solved-form-array-help/#findComment-759752 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.