Skip to main content

Posts

Showing posts with the label How can insert multiple textboxes value in the database ..

How to insert multiple textbox values into database in php

How to insert multiple textbox values into database in php <?php    $post_count = count($_POST['textfield']); //count textfield values $post1 = array(); //create array $post2 = array(); $post1 = $_POST['textfield']; $post2 = $_POST['textfield2']; for ($i = 0; $i <= $post_count; $i++) {     $sql[] = "INSERT INTO practice (test,test2) VALUES ('".$post1[$i]."','".$post2[$i]."')"; } foreach ($sql as $query) {     mysqli_query($con, $query); } ?>