You are here: Re: [PHP] checkboxes « PHP « IT news, forums, messages
Re: [PHP] checkboxes

Posted by Brent Baisley on 10/12/64 11:33

Excellent response. You should always be expecting certain data. So
if no checkboxes are checked, your code should realize that since it
was expecting the data and none was submitted.
The "lazy way" is much easier to code, but it is actually fairly
efficient. You are only hitting the database twice, once of the
delete and once for the bulk insert. On a fixed record length table,
the lazy way may actually be quicker.

On Nov 30, 2005, at 2:23 AM, Curt Zirzow wrote:

> So we have a form that will eventually need to knnow what values
> should be selected. Potentially data alreadly exists that may have
> the same records. There are two options (or perhaps more) to
> approach this:
>
> Decide as we go approach and clean up:
>
> 1) Grap the 'vehicles' currently assoicated with the 'lot'
> 2) if 'vehicle' is currently selected do nothing
> 3) if 'vehicle' is a new item we should add 'vehicle' as long as it
> is a valid 'vehicle;
> 4) repeat 2 and 3 until we looked at all the data
> 5) figure out which ones should be deleted and delete them.
>
>
> Forget everything, we'll add what is valid (the lazy way):
>
> 1) delete every associated record to the 'lot'
> 2) for each 'vehicle' add 'vehicle' as long as it is a valid
> 'vehicle'
>

--
Brent Baisley
Systems Architect
Landover Associates, Inc.
Search & Advisory Services for Advanced Technology Environments
p: 212.759.6400/800.759.0577

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация