Received: from localhost.localdomain (postgresql.org [64.49.215.8]) by localhost (Postfix) with ESMTP id E7ECF475E29 for ; Mon, 29 Apr 2002 12:17:19 -0400 (EDT) Received: from mail.bungeecode.com (aniyogi-5.mylinuxisp.com [216.39.203.94]) by postgresql.org (Postfix) with ESMTP id 230CC47598C for ; Mon, 29 Apr 2002 11:58:54 -0400 (EDT) Received: from cs666899-134.austin.rr.com ([66.68.99.134] helo=bungeecode.com) by mail.bungeecode.com with esmtp (Exim 3.33 #1) id 172DZa-0004Yh-00; Mon, 29 Apr 2002 11:00:18 -0500 Message-ID: <3CCD6DAF.6060005@bungeecode.com> Date: Mon, 29 Apr 2002 10:58:39 -0500 From: Surojit Niyogi User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:0.9.9+) Gecko/20020424 X-Accept-Language: en-us, en MIME-Version: 1.0 To: "Julio Cuz, Jr." Cc: php-db@lists.php.net, pgsql-php@postgresql.org Subject: Re: Check Boxes References: <5.1.0.14.0.20020429083154.00a89760@mail.rccd.cc.ca.us> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Archive-Number: 200204/101 X-Sequence-Number: 1125 Julio, The way I see it checkboxes are just boolean graphical representations. Either a "yes" or "no" value if the box is checked or not, respectively. Hence, it would make sense for the field to be of type "bool". As far as storing goes, PHP sees a checked box of having a value of "on" and an unchecked box of having a value of false (or empty). So what I typically do is have a function called is_checked() that passes the form field. function is_checked($form_field){ global $HTTP_POST_VARS; if($HTTP_POST_VARS[$form_field[ == "on") return 1; else return 0; } In my SQL statement I pass the returned value directly $strSQL = "INSERT INTO blah (is_foo) VALUES (" . is_checked('is_foo') . ")" Hope this helps. :D -Roj Niyogi Founder pgHoster PostgreSQL web hosting http://www.pghoster.com Julio Cuz, Jr. wrote: > Hi-- > > Does anyone have any suggestions, SAMPLES, or ideas on how to STORE, > RETRIEVE, AND PROCESS values for "Check Boxes" w/PHP & Postgresql? > > Thanks! > > Julio Cuz, Jr. > Riverside Community College > jcuz@rccd.cc.ca.us > > > ---------------------------(end of broadcast)--------------------------- > TIP 2: you can get off all lists at once with the unregister command > (send "unregister YourEmailAddressHere" to majordomo@postgresql.org) > >