What I meant by string manipulation is something like this (ignoring simple code errors):
$query = 'INSERT INTO table (col1, col2) values (1,';
if (strlen($val) > 0) { // or a null check, or something
$query .= $val;
} else {
$query .= 'NULL';
}
$query .= ')';
then execute it. Not a huge hastle, but if there's lots of parameters that could be null it's just a bit of typing, and more importantly it makes maintenance more difficult than if the insert did the NULL thing automatically.
If you have a better way i'm all ears 🙂
Thanks for your help 🙂