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