I understand a little more now - it's got to be null without quotes:
$sql = "INSERT INTO cpeventdates (eventid,startdate,enddate,starttime,endtime) VALUES ('$eventid','$startdate',null,'$starttime','$endtime')";
and not null with quotes:
$sql = "INSERT INTO cpeventdates (eventid,startdate,enddate,starttime,endtime) VALUES ('$eventid','$startdate','null','$starttime','
$endtime')";
Of course it's easy enough to type it in, and easy enough to get "null" in quotes, but how to phrase it so that IF $enddate == "", it sticks in null WITHOUT quotes - that's hurting my brain.
I can see how Lars' suggestion would work - sort of. I don't understand the syntax though - why the multiple "$sql"s, and just how to make it stop erroring.
Can someone help me get my syntax straight?