I got 10 rows, 14 columns but they are not required, so a user can enter just a column in the middle of the table on the 5th row.
Also i use UPDATE statement for the mysql queries.
I want to ask if there is a way to count the amount of rows the user enters. I've had a few ideas like the in_array() function but that didnt turn out well, or using a for statement, and an if statement... something like:
Code: Select all
for($a = 0; $a <= 9; $a++){
$rowa = $row1 . $a; //$row1 is the name of the column and im using $a to give it an unique name so i can call it easier
$rowb = $row2 . $a;
...
...
...
If($_POST["$rowa"] == "^" OR $_POST["$rowb"] == "^" OR ...... ){ // "^" is a wildcard i've used in mysql so i can update even if i'm supposed to use INSERT. (i've got my reasons to use UPDATE )
$counter++;
}
}Anyone got any ideas?
And of course suggestions to my original code is greatly appreciated.
Thank you.