store array data retrieved from forms to database <p>I have a form. And there is add button to add more forms according to requirement. The Working demo is in JSFiddle. <a href="https://jsfiddle.net/szn0007/eanhpLkg/" rel="nofollow">https://jsfiddle.net/szn0007/eanhpLkg/</a></p> <p>My PHP code is :</p> <pre><code>$data['client_name'] = $_POST['client_name']; $data['address'] = $_POST['address']; $data['fiber_length'] = $_POST['fiber_length']; $data['phone_number'] = $_POST['phone_number']; $data['package'] = $_POST['package']; $data['result'] = $_POST['result']; $data['remarks'] = $_POST['remarks']; foreach($data['client_name'] as $c ) { $sql = "INSERT INTO ct_staff_activity_ftth(client_name) VALUE('$c') "; $this-&gt;db-&gt;query($sql); } </code></pre> <p>How can i insert all the dataas entered at once.</p>