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. 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. 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 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
Archived
This topic is now archived and is closed to further replies.