Re: Preventing Duplicate Record Insertion on Page Refresh
Well, it's hard to provide an answer like this.. Can you paste some code and explain to us what are trying to achieve? If you're inserting text and there is something else that needs to be unique, you will need a custom validation rule for your Model. On Dec 11, 12:58 pm, chowdary <[EMAIL PROTECTED]> wrote: > i am validating the data b4 inserting. but the data type is text.. > the text will not be unique... > > explain me clearly... --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Preventing Duplicate Record Insertion on Page Refresh
You should use the redirect after post pattern, using a HTTP 302 or 303 status code after saving your fields. if($this->Model->save()) $this->redirect($url, $code, $exit); On Dec 11, 12:58 pm, chowdary <[EMAIL PROTECTED]> wrote: > i am validating the data b4 inserting. but the data type is text.. > the text will not be unique... > > explain me clearly... --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Preventing Duplicate Record Insertion on Page Refresh
Create a session variable and set it to false. Have your page check the session variable every time it loads. If the session variable is false, save the data and set the variable to true. If it is true, don't save the data. I could be more specific, but I don't know exactly what you are doing. If you can give us an idea of what your app does, that would be great. hydra12 On Dec 11, 5:58 am, chowdary <[EMAIL PROTECTED]> wrote: > i am validating the data b4 inserting. but the data type is text.. > the text will not be unique... > > explain me clearly... --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Preventing Duplicate Record Insertion on Page Refresh
i am validating the data b4 inserting. but the data type is text.. the text will not be unique... explain me clearly... --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Preventing Duplicate Record Insertion on Page Refresh
You should set some validation rules for your Model, and setup a custom rule to check whether the submitted data is already in the database, OR implement Model::beforeSave() Hope that helps, dr. H. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Preventing Duplicate Record Insertion on Page Refresh
I am developing a PHP-mysql database. It is noted that when the browser window is refreshed the data is inserted again in the database. unfortunately there is no unique keys that I can use to verify the existance of the data, so as to prevent the multiple insertion. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---