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); } ?>
PHP,WORDPRESS,CAKEPHP,JQUERY,PHP TUTORIALS,CAKEPHP TUTORIALS,JQUERY CODES, CSS CODES, HTML CODES,EXPO, React, React Native, Angular,OOPS ,PHP INTERVIEW QUESTIONS @shubham715