For Programmers: Free Programming Magazines  


Home > Archive > PHP DB > July 2005 > RE: [PHP-DB] Duplicate record









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author RE: [PHP-DB] Duplicate record
Martin B. Nielsen

2005-07-30, 8:59 am

Would'nt the simplest just setting one of the rows as UNIQUE? Or you can add
one query that checks if one of the values already exists in the database.

Best regards,
Martin

-----Original Message-----
From: Hallvard [mailto:hallvard@natvik.com]
Sent: 30. juli 2005 12:17
To: php-db@lists.php.net
Subject: [PHP-DB] Duplicate record

I have a page that posts data from a form to a mysql database.

The problem is that if the user hits the reload button on the browser, the
data will be posted again, resulting in a duplicate record.

How can I avoid that?

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com