can you please write a simple easy to understand php statement that shows atleast one line of cells being inserted into the db. because for some reason my head is not being able to understand how to do this.
when i click on add row what i cant figure out is where do these textboxe variables going? so that i can see the textboxes names being created.
You're putting values inside of the brackets for your input array. You can do this, but because you want an unlimited number of potential rows, you should omit it and let the array take care of itself.
Here's a quick and dirty example of what happens with the data when you do this. On submit the script will display the $_POST array as it looks in it's entirety and also the smaller array that is created from the input fields. This should give you an idea of how to put the data where you want it, what it'll look like when it gets there, and how to then deal with it afterwards;
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Untitled Document</title> </head>
So, four records, but the last number is three. When you run count() on it, it tells you that there are four records. When you run the for loop without subtracting one from the result of count() you're actually running the for loop up to index  which doesn't exist.