Arrrgh!
Nulls...the bane of my existence. I still don't get it.
I am trying to POST some data to a MySQL insert script from a form that allows the user to input multiple records (rows) at a time. The POST data is sent via individual arrays.
For example... (very abbreviated here... all the stuff that loops the inputs through each record/row works fine)
Each row of the input form will be like so:
<tr><td><input type=\"text\" name=\"NAME[]\" value=''><input type=\"text\" name=\"SCORE[]\" value=''></td></tr>
The values then pass to the insert script just fine...
(Next page, Destination script...)
$NAME = $POST['NAME'];
$SCORE = $POST[SCORE];
The insert query works just fine...
INSERT INTO '.$TableName .'(NAME, SCORE) VALUES ('$NAME[$i]', '$SCORE[$i]', ....
EXCEPT....
Sometimes there is NO SCORE VALUE to report and I want a NULL entered into the destination row for that record, not a 0...but I always end up with a zero in the cell.
😕