SV: [PHP-DB] checkboxes and loops

2004-03-29 Thread Henrik Hornemann
Hi, Try: $counter = 1; while (whatever) { $varname = 'box'.$counter; if ($$varname == 'delete') do whatever $counter++; } Hth Henrik Hornemann -Oprindelig meddelelse- Fra: matthew perry [mailto:[EMAIL PROTECTED] Sendt: 29. marts 2004 07:45 Til: [EMAIL PROTECTED] Emne: [PHP-DB]

RE: [PHP-DB] checkboxes and loops

2004-03-29 Thread Duane Lakoduk
I am relatively new with PHP, but have done this many times with ASP. First, I would not assign the counter value to the checkbox as you are now. Use the ID (identity) value from the database for the applicant record instead. Since ONLY the checkboxes that are checked will be submitted, you can

Re: [PHP-DB] checkboxes and loops

2004-03-29 Thread John W. Holmes
matthew perry wrote: input type = checkbox name = box?echo $counter;? value = delete $counter++; *Bad solution 2 (doesn't work)*** $counter = 1; while (whatever) { if ($box . $counter == 'delete') do whatever $counter++; } *** if(${$box .

Re: [PHP-DB] mysqli - using PREPARED STATEMENTS - worth it?

2004-03-29 Thread John W. Holmes
PHP freak wrote: Looking at this page: http://us2.php.net/manual/en/function.mysqli-prepare.php Also the new book ADVANCED PHP PROGRAMMING uses the new MySQLi Prepared Statements for all queries. Wondering if that extra code, trouble, and lack of flexibility is worth it? Will it be a HUGE

Re: [PHP-DB] mysqli - using PREPARED STATEMENTS - worth it?

2004-03-29 Thread John W. Holmes
PHP freak wrote: Looking at this page: http://us2.php.net/manual/en/function.mysqli-prepare.php Read this, too: http://www.zend.com/php5/articles/php5-mysqli.php -- ---John Holmes... Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/ php|architect: The Magazine for PHP Professionals

[PHP-DB] DATE_SUB Issues

2004-03-29 Thread Craig Hoffman
Hi There, Perhaps someone could lend me a hand here on this query. I have a query where I would like it to SUM up the last 7 days of records further, It needs to start a new week on Monday. The 'time_upload' field is a datetime field. What am I doing wrong or not doing here ? SELECT

Re: [PHP-DB] DATE_SUB Issues

2004-03-29 Thread Craig Hoffman
still no luck - any other suggestions? __ Craig Hoffman - eClimb Media v: (847) 644 - 8914 f: (847) 866 - 1946 e: [EMAIL PROTECTED] w: www.eclimb.net _ On Mar 29, 2004, at 8:18 AM, John W. Holmes wrote: From: Craig Hoffman [EMAIL

Re: [PHP-DB] DATE_SUB Issues

2004-03-29 Thread John W. Holmes
From: Craig Hoffman [EMAIL PROTECTED] still no luck - any other suggestions? Please define no luck ---John Holmes... On Mar 29, 2004, at 8:18 AM, John W. Holmes wrote: From: Craig Hoffman [EMAIL PROTECTED] Perhaps someone could lend me a hand here on this query. I have a query

Re: [PHP-DB] DATE_SUB Issues

2004-03-29 Thread Craig Hoffman
What is should doing is grabbing all entries of this week and return a total. Its returning the wrong results. SELECT SUM(distance), DATE_FORMAT(time_upload, '%u'), WEEK(time_upload, 1) FROM TRAININGLOG WHERE DATE_SUB( NOW(),INTERVAL 7 DAY ) = time_upload GROUP BY time_upload LIMIT 1 =

Re: [PHP-DB] DATE_SUB Issues

2004-03-29 Thread Craig Hoffman
WooHoo! I got it working! Basically what I did is I changed this DATE_SUB( NOW(),INTERVAL 7 DAY ) to DATE_SUB( NOW(),INTERVAL 1 DAY ) and it worked. I am not entirely sure why. Anyone know? __ Craig Hoffman - eClimb Media v: (847) 644 - 8914 f: (847) 866 -

[PHP-DB] INSERT problem--Need help urgently

2004-03-29 Thread irinchiang
Hi all: I was having some problem with INSERT query here and do hope to get some help real soon. I have a form whereby once the form is submitted, the values entered shall be inserted into the database. Next I have also written a SELECT query to view the records which have just been inserted