cbro you are exactly correct. Now its working fine. Thanks for others also who suggested to correct my code.
In reply to Re^2: dbi with cgi by Anonymous Monk in thread dbi with cgi by Anonymous Monk