Trying to insert this array facing
Array to string conversion error
but data is inserting in DB
$connect = new PDO("mysql:host=localhost; dbname=dentist", "root", "");
if (isset($_POST['problem'])) {
$problem = $_POST['problem'];
$tooth = $_POST['tooth'];
$intervention = $_POST['intervention'];
For loop using to insert array
for ($i = 0; $i < count($problem); $i++) {
$query = "INSERT INTO tbl_finds (problem, tooth, intervention)
VALUES ($problem[$i], $tooth[$i], $intervention[$i])";
$stmt = $connect->prepare($query);
$stmt->execute(array($_POST['problem'], $_POST["tooth"], $_POST["intervention"]));}}