Received: from localhost.localdomain (postgresql.org [64.49.215.8]) by localhost (Postfix) with ESMTP id 3A8B9476BFE for ; Thu, 20 Jun 2002 12:48:40 -0400 (EDT) Received: from visi.net (arsenal.visi.net [206.246.194.60]) by postgresql.org (Postfix) with ESMTP id 2CFC84769F0 for ; Thu, 20 Jun 2002 12:36:53 -0400 (EDT) X-Virus-Scanner: McAfee Virus Engine Received: from [216.54.6.254] (HELO localhost.localdomain) by visi.net (CommuniGate Pro SMTP 3.5.6) with ESMTP id 34978200 for pgsql-php@postgresql.org; Thu, 20 Jun 2002 12:35:32 -0400 Subject: Problem involving checkbox and Postgresql From: Jeff Self To: pgsql-php@postgresql.org Content-Type: text/plain Content-Transfer-Encoding: 7bit X-Mailer: Ximian Evolution 1.0.7 Date: 20 Jun 2002 12:36:40 -0400 Message-Id: <1024591004.13953.13.camel@jselfpc> Mime-Version: 1.0 X-Archive-Number: 200206/33 X-Sequence-Number: 1286 I've got a table with a field called driving_required with a boolean type and default 'true'. I've built a web page which contains the following lines for displaying a checkbox: Driver's License Required? After the form is submitted, it calls a php file called jobpostresults.php which enters the data from the form into the database and displays the results on the page. Here's the section that enters the form data into the database: // Add Job Description Details $jddquery = "INSERT INTO job_description_details (description_id, effective_date, driving_required, submitted_on, submitted_by, sm_description, responsibilities, behaviors, skills, experience, requirements) VALUES ('$description_id','$effective_date','$driving_required',now(),'$submitted_by','$sm_description','$responsibilities','$behaviors','$skills','$experience','$requirements')"; $jddresult = pg_exec($conn, $jddquery); if (!$jddresult) exit; When I input the data and click on submit I get the following error message: Warning: pg_exec() query failed: ERROR: Bad boolean external representation 'on' in /var/www/nngov/admin/jobpostresults.php on line 46 It looks like the html form is producing 'on' for the value of driving_required. How do I get this changed to 'true' in PostgreSQL? -- Jeff Self Information Technology Analyst Department of Personnel City of Newport News 2400 Washington Avenue Newport News, VA 23607 757-926-6930