REQUEST_ID is the primary key and auto increment. all other fields are of type varchar. none of them except primary key is NOT NULL. and to be specific for first couple of times when I call the cgi script some fields for example $FROM_URL will be passing NULL. Does that creating a problem ?

The next step would be to make sure that each of the vars are defined. The ones that are currently undef should be defined with an empty string or with 'NULL'. There are a couple ways to do that, here's one: