Ok so here it goes: I have an array that is attached to a web form. It's function is to ask the user what she has been involved in. There are 3 rows with 4 columns each. The user is required to fill out at least one row but not all three. Here is the problem. When I test it out all three rows are entered into the database wether they hold information or not. How do I get the parser to recognize when a row is blank and ignore it before the info is inserted into the database? Here is the PHP Code for the Array foreach($_POST['Activity'] as $row=>$Act) { $Activity=($Act); $Position=($_POST['Position'][$row]); $StartDate=($_POST['StartDate'][$row]); $EndDate=($_POST['EndDate'][$row]); if (!empty($Act)) { $involv = "INSERT INTO Involvement (Activity, Position, StartDate, EndDate) VALUES ('$Activity','$Position','$StartDate','$EndDate')"; }; Thanks in advance
You could use regex, which I've never used before, and I'd certainly be interested in the solution you will embark on, because I need to implement a similar system in my intranet project.