Received: from localhost.localdomain (postgresql.org [64.49.215.8]) by localhost (Postfix) with ESMTP id BF441476CC0 for ; Thu, 20 Jun 2002 13:51:41 -0400 (EDT) Received: from secure.pghoster.com (unknown [64.246.32.44]) by postgresql.org (Postfix) with ESMTP id 7E27F476E6F for ; Thu, 20 Jun 2002 13:39:21 -0400 (EDT) Received: from bungeecode.com (cs666898-142.austin.rr.com [66.68.98.142]) (authenticated (0 bits)) by secure.pghoster.com (8.11.6/8.11.6) with ESMTP id g5KIZki15667; Thu, 20 Jun 2002 13:35:46 -0500 Message-ID: <3D12135F.4040309@bungeecode.com> Date: Thu, 20 Jun 2002 12:39:43 -0500 From: Surojit Niyogi User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.1a) Gecko/20020617 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Jeff Self Cc: pgsql-php@postgresql.org Subject: Re: Problem involving checkbox and Postgresql References: <1024591004.13953.13.camel@jselfpc> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Archive-Number: 200206/34 X-Sequence-Number: 1287 Hi Jeff, Set the value parameter in the input tag That should work I believe. -Surojit Jeff Self wrote: >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? > name="driving_required" CHECKED> > >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? > > >