n000bie Posted November 8, 2009 Share Posted November 8, 2009 i got a form array <input type="text" maxlength="64" size="35" name="curEmpName[]" class="required" title="Please enter organization name" value=""/> with this code i can echo the name entered in the screen but how can i save all the data separated by (,) in same field of table foreach ($_POST['curEmpName'] as $value) { // Do something with each valid friend entry ... if ($value) { echo $value."<br />"; } } can anyone give me hint pls. Quote Link to comment https://forums.phpfreaks.com/topic/180737-solved-saving-form-array-through-php/ Share on other sites More sharing options...
Daniel0 Posted November 8, 2009 Share Posted November 8, 2009 You can do like join(',', $_POST['curEmpName']);. You should look into database normalization though. Generally, one field in a relational database should only contain one single value. Quote Link to comment https://forums.phpfreaks.com/topic/180737-solved-saving-form-array-through-php/#findComment-953561 Share on other sites More sharing options...
n000bie Posted November 8, 2009 Author Share Posted November 8, 2009 ok thank you Quote Link to comment https://forums.phpfreaks.com/topic/180737-solved-saving-form-array-through-php/#findComment-953563 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.