Reply to Re: edit/update - all in one PHP pages?

Your name:

Reply:


Posted by Kenneth Downs on 08/26/05 16:52

Jim wrote:

>
> 1) combine editfred.php and updatefred.php. Again, I'm not keen on this
> but it does seem the most logical and programatically easiest.
>

We do it this way and it works out well. The trick is to divide the
processing into two stages. First is data processing ( do an update,
insert or delete), and second is display.

You can then control flow by having the results of data processing, stage 1,
determine what happens in stage 2.

So for example the user requests to input a new row. This is a simple case
where there is no data processing yet, so you do nothing at Stage 1 and at
Stage 2 you return the HTML INPUT controls to enter a new row.

Going further, the user now saves the new row, so at Stage 1 you must do the
insert. If the insert succeeds, then in Stage 2 you go to Display mode and
show them the row they just put in. But if the insert fails, you set the
flag to return them to Insert mode and display the error message.

In like fashion, you work out what you want to happen on each data
processing action. What happens when it fails, what happens when it
succeeds. So perhaps on a successful delete you move to the next row in
the search results, but on fail you return to display mode and show them
the row with the error message.

--
Kenneth Downs
Secure Data Software, Inc.
(Ken)nneth@(Sec)ure(Dat)a(.com)

[Back to original 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

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