Re: [PHP-DB] Check Boxes

2004-08-18 Thread John Holmes
balwantsingh wrote: can somebody advise me i want to use checkboxes on my website, i want that if user selects some checkboxes (there will be more than 20 checkboxes), checkbox's value will be stored in variables and than SELECT query command will be run using these variables through PHP. but my

RE: [PHP-DB] Check Boxes

2004-08-18 Thread balwantsingh
=Opening_Units Unit_Consumedinput type=checkbox name=ch3 value=Unit_Consumed -Original Message- From: John Holmes [mailto:[EMAIL PROTECTED] Sent: Wednesday, August 18, 2004 5:43 PM To: [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Subject: Re: [PHP-DB] Check Boxes balwantsingh wrote: can

Re: [PHP-DB] Check Boxes

2004-08-18 Thread randy
Unit_Consumedinput type=checkbox name=ch3 value=Unit_Consumed -Original Message- From: John Holmes [mailto:[EMAIL PROTECTED] Sent: Wednesday, August 18, 2004 5:43 PM To: [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Subject: Re: [PHP-DB] Check Boxes balwantsingh wrote: can

RE: [PHP-DB] Check Boxes

2004-08-18 Thread Ford, Mike [LSS]
On 18 August 2004 11:24, randy wrote: $chkboxes = $_POST['ch']; $sql = 'SELECT '; foreach($chkboxes as $k = $v) { $sql .= $v; if($k (sizeof($chkboxes) - 1)) { $sql .= ', '; } } $sql .= ' FROM form'; $sql = 'SELECT ' . implode(', ', $chkboxes) .

Re: [PHP-DB] Check Boxes

2004-08-18 Thread randy
yeah yeah...it's damn near 4 in the morning here...my brain isn't exactly on at the moment. :) On Wed, 18 Aug 2004 11:35:59 +0100, Ford, Mike [LSS] [EMAIL PROTECTED] wrote: On 18 August 2004 11:24, randy wrote: $chkboxes = $_POST['ch']; $sql = 'SELECT '; foreach($chkboxes

Re: [PHP-DB] Check Boxes

2004-08-18 Thread John Holmes
Ford, Mike [LSS] wrote: $chkboxes = $_POST['ch']; $sql = 'SELECT '; foreach($chkboxes as $k = $v) { $sql .= $v; if($k (sizeof($chkboxes) - 1)) { $sql .= ', '; } } $sql .= ' FROM form'; $sql = 'SELECT ' . implode(', ', $chkboxes) . 'FROM form';

RE: [PHP-DB] Check Boxes

2004-08-18 Thread Ford, Mike [LSS]
On 18 August 2004 15:53, John Holmes wrote: Ford, Mike [LSS] wrote: $chkboxes = $_POST['ch']; $sql = 'SELECT '; foreach($chkboxes as $k = $v) { $sql .= $v; if($k (sizeof($chkboxes) - 1)) { $sql .= ', '; } } $sql .= ' FROM form';

Re: [PHP-DB] Check Boxes

2004-08-18 Thread Jason Wong
On Wednesday 18 August 2004 20:07, Ford, Mike [LSS] wrote: $sql = 'SELECT ' . implode(', ', $chkboxes) . 'FROM form'; Just note that with either solution, someone can post a value of * FROM table WHERE 1# and see everything in any table in your database. I was waiting for someone to

RE: [PHP-DB] check boxes and php

2003-03-27 Thread Hutchins, Richard
John, There a few good threads in the PHP-DB archives that will guide you through implementing your check box solution. Here is one of the most recent: http://marc.theaimsgroup.com/?l=php-dbm=104610149123353w=2 In the past, I've implemented check boxes for the purpose of deleting News items

RE: [PHP-DB] Check Boxes

2002-04-29 Thread Cal Evans
I usually store the value as a 0 (unchecked) or a 1(checked) in a char(1) field. Then, in populating the form my input has something like ?PHP echo (fieldname==1?' CHECKED ':'';? There are other ways of doing it. (Warning, I'm not actually LOOKING at my code at the moment so YMMV.) HTH, =C= *

RE: [PHP-DB] Check Boxes!

2001-10-22 Thread Rick Emery
Sometimes, PHP becaomes confused when a variable is included in another word, such as you are doing with $i in: if($HTTP_POST_VARS[chkAuthStatus_$i] = 'on') To avoid this problem, use braces to segregate the PHP variable from the rest of the word: try: if($HTTP_POST_VARS[chkAuthStatus_${i}] =

RE: [PHP-DB] Check Boxes/UPDATE

2001-10-03 Thread Jason Wong
-Original Message- From: Jason G. [mailto:[EMAIL PROTECTED]] Sent: 03 October 2001 12:12 To: Matt C; [EMAIL PROTECTED] Subject: Re: [PHP-DB] Check Boxes/UPDATE Matt, Assuming that you have a variable number of records being displayed out of the database: As you write out the HTML

RE: [PHP-DB] Check Boxes/UPDATE

2001-10-03 Thread Matt C
I am sorry but I still really don't get it :( How do I do the array thing? _ Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail:

RE: [PHP-DB] Check Boxes/UPDATE

2001-10-03 Thread Rick Emery
Boxes/UPDATE I am sorry but I still really don't get it :( How do I do the array thing? -Original Message- From: Jason G. [mailto:[EMAIL PROTECTED]] Sent: 03 October 2001 12:12 To: Matt C; [EMAIL PROTECTED] Subject: Re: [PHP-DB] Check Boxes/UPDATE Matt, Assuming that you have

RE: [PHP-DB] Check Boxes/UPDATE

2001-10-03 Thread Jason Wong
-Original Message- From: Matt C [mailto:[EMAIL PROTECTED]] Sent: 03 October 2001 23:17 To: [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject: RE: [PHP-DB] Check Boxes/UPDATE I am sorry but I still really don't get it :( How do I do the array thing? Please specify *which* part you don't

RE: [PHP-DB] Check Boxes/UPDATE

2001-10-02 Thread Dave Watkinson
Hiya Matt you have to set the value of the checkbox to 1, and give it a unique name. if the user has checked the box when they submit the form then the checkbox' name will have a value of 1. if they didn't check it it won't have a value at all. Hope this helps! Dave -Original

Re: [PHP-DB] Check Boxes/UPDATE

2001-10-02 Thread Jason G.
Matt, Assuming that you have a variable number of records being displayed out of the database: As you write out the HTML, give each checkbox a name containing the ID# of the record that is being written out. Ex: input type=check name=chkAuthStatus_1203 checked input type=check