You are here: Re: Duplicate records added from post forms, easy solutions? « PHP Programming Language « IT news, forums, messages
Re: Duplicate records added from post forms, easy solutions?

Posted by Sheldon Glickler on 07/16/06 14:36

"mindwarp" <mindwarpltd@gmail.com> wrote in message
news:1152955864.173058.229680@p79g2000cwp.googlegroups.com...
> Hi,
>
> When a user submits / posts data my php script Inserts data into my
> database.
> If they refresh the script or click back and click submit again I get
> duplicate record.
>
> Is there an easy solution to this?
>
> Or do I need to create a hidden field which contains some sort of
> unquie data, like a time stamp and have a have a unique field which
> stops it adding the record?

Generally I have a primary key and the "WHERE" clause prevents duplicates.
However, to avoid errors you could check first for its existence and the
either ignore it, send a message, or do an UPDATE.

Shelly

 

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

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