php - How iterate through controls in a form? -
i'm pretty new php , i'm working on first php website. have need display (and add/edit) rows in table in single form.
what i'm going row in form each row in table plus 1 blank row user can add more items table.
when click save button want existing rows update , new row (if data present) insert.
is there easy way can iterate through controls in form or of sort?
you can iteratore through $_post array using foreach construct, not forget validate key names against column names (or row names, can't grasp database design, because woke up).
foreach($_post $key => $value) { // stuff }
and if it's first php website, don't forget sql injection.
Comments
Post a Comment