in reply to INSERT NOT EXECUTING
Instead of die "NOT WORKING" you should as well spit out the error string:
die "NOT WORKING: ".$DIVDATA->errstr; [download]