«i just copy pasted u r codein the middle now it shows Undefined variable: parentPathPieces»

sir im having similar problem with the count function in php
im new to php & mysql

my code is very simple

<?php if(isset($_POST['submit'])) { $biln= $_POST['billno']; if ($parentPathPieces && count($parentPathPieces) == 1) { for($i=0; $i < count($_POST['itemnameA']); $i++) { $result= mysqli_query($conn, "INSERT INTO billinfo (billno,item_name,item_code,rate,quantity,total) VALUES ('$biln','{$_POST['itemnameA'][$i]}','{$_POST['itemcodeA'][$i]}','{$_POST['rateA'][$i]}','{$_POST['quantityA'][$i]}','{$_POST['totalA'][$i]}')") or die(mysqli_error($conn)); } } } ?>

i just copy pasted u r code if ($parentPathPieces && count($parentPathPieces) == 1) { in the middle now it shows Undefined variable: parentPathPieces in
i know that the variable i not assigned , but what i dose’nt have idea is whats tht code for and where , how should i place it inside my php and make it working , im completely new pls teach me in a way like a beginner can understand.