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

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 .= ', '; > > > } > > > } > > >

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'; J

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($

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(', ',

Re: [PHP-DB] Check Boxes

2004-08-18 Thread randy
g_Units > 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 > > balwantsin

RE: [PHP-DB] Check Boxes

2004-08-18 Thread balwantsingh
ge- 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 somebody advise me > i want to use checkboxes on my website, i want that if user selects some >

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 p

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-db&m=104610149123353&w=2 In the past, I've implemented check boxes for the purpose of deleting News items al

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 There are other ways of doing it. (Warning, I'm not actually LOOKING at my code at the moment so YMMV.) HTH, =C= * * Cal Evans * Journeyman Programmer * Tec

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!

2001-10-20 Thread p.whiter
Try removing the parenthesis from your update sql query $sql = "UPDATE vacancies SET AuthStatus='1' WHERE JobID = '$JobID'"; HTH Paul - Original Message - From: "Matt C" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Saturday, October 20, 2001 12:43 AM Subject: [PHP-DB] Check

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 t

RE: [PHP-DB] Check Boxes/UPDATE

2001-10-03 Thread Rick Emery
eck 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 > >

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: [E

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 >

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: Use code like the following to Write and Read the web form... id;

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 Message--