Re: [PHP-DB] Duplicate record

2005-08-03 Thread annA
Hello, How about this for a different method: The php that displays the form writes an extra hidden field to the form, containing a random string value. It also writes that random string along with a timestamp to a database table, called say, form_control. The form action sends to a separate

Re: [PHP-DB] Duplicate record

2005-08-01 Thread Hallvard
Thanks! I had already dealt with the problem using unique key, as many others suggested. However, the records (post your comment-type) doesn't have any natural key, so I had to concotinate several long text strings, which isn't nice. Could you point me in the direction of any code examples

Re: [PHP-DB] Duplicate record

2005-08-01 Thread Micah Stevens
If its a potentially long message you're storing, you can always create an MD5 sum during insertion, compare it to existing MD5 sums, and if they don't match, there's not duplicates. Just as an example, if you're inserting message and user data, first see if there's duplicates: if

[PHP-DB] Duplicate record

2005-07-30 Thread Hallvard
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,

RE: [PHP-DB] Duplicate record

2005-07-30 Thread Martin B. Nielsen
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

Re: [PHP-DB] Duplicate record

2005-07-30 Thread balwant singh
in my opinion you can do the following: 1) once the user submitted the form, redirect to a new page OR 2) may have a unique column in database to avoid duplication like userid etc. With Best Wishes Balwant Singh INDO ASIAN FUSEGEAR LTD. A-39, HOSIERY COMPLEX PHASE

Re: [PHP-DB] Duplicate record

2005-07-30 Thread Miles Thompson
Do a seek on the fields which cannot be duplicated; if there's a hit reload the page with the appropriate error message, otherwise reload the page with a success message. Although I have not worked with AJAX, this would appear to be an excellent spot to use it. Silently check after focus

Re: [PHP-DB] Duplicate record

2005-07-30 Thread Bastien Koert
after entering the data, send the user to another (confirmation) page...then you avoid the possiblity of duplicates Bastien From: Miles Thompson [EMAIL PROTECTED] To: Hallvard [EMAIL PROTECTED], php-db@lists.php.net Subject: Re: [PHP-DB] Duplicate record Date: Sat, 30 Jul 2005 10:54:16 -0300

Re: [PHP-DB] Duplicate record

2005-07-30 Thread Alexander Veremyev
You could use next simple rules to avoid this problem: 1. Never change anything in your storage (database) by GET HTTP request method. 2. Never prepare any Web page by POST method. 3. After Form is processed (with a POST method) use HTTP redirect to corresponding GET page which should

Re: [PHP-DB] Duplicate record

2005-07-30 Thread Ryan Grange
Alexander Veremyev wrote: You could use next simple rules to avoid this problem: 1. Never change anything in your storage (database) by GET HTTP request method. 2. Never prepare any Web page by POST method. 3. After Form is processed (with a POST method) use HTTP redirect to corresponding