in reply to Weird CGI behaviour on different Browsers - Apache

Update: ... If you got any pros/cons if this could be what's wrong or not, feel free to let me know.

In addition you should disable the submit button to prevent double clicks, and definitely still introduce constraints on your database.

  • Comment on Re: Weird CGI behaviour on different Browsers - Apache

Replies are listed 'Best First'.
Re^2: Weird CGI behaviour on different Browsers - Apache
by Yaerox (Scribe) on Aug 04, 2015 at 13:57 UTC
    I'm thinking about that, but this decision shouldn't be in a rush because my real database table logically allowes to have dublicated numbers because the type is different. Type is order notice or bill. I'll just let this here, but I'm seriously thinking about it. Thanks.

      A constraint can span more than one column. You need to think about this long from a business perspective, but if you are certain that the combination (number, type) needs to be unique, you can create a constraint or a unique index for that.

        CONSTRAINT on type, number could be a really great idea. I'll discuss this with some fellows and see what I do. I hope I won't miss to update this topic. Maybe it could help anyone someday for taking decisions.

      A better database design would be to have your orders and invoices in separate tables with customers in a third. It may or may not relate to your problem, but it is clearer, less error-prone, probably more efficient, easier to debug, and way easier to develop code for.

      The way forward always starts with a minimal test.