#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2011
    Posts
    15
    Rep Power
    0

    Duplicate Insertion


    I have form on my website i am testing to insert a username into my database using Dreamweaver Insert behaviour which works. However the problem i am having happens when i click the submit button multiple time i get the same record inserted twice. Does anyone know how i can rectify this problem? Thanks in advance
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Loyal (3000 - 3499 posts)

    Join Date
    Jul 2003
    Posts
    3,383
    Rep Power
    594
    While you can disable the button via javascript after it is clicked, if you really want to prevent duplicates, you need to code your PHP to check for that user in the database before inserting it. You can also prevent that by defining the user field as unique in the database.
    There are 10 kinds of people in the world. Those that understand binary and those that don't.
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2011
    Posts
    15
    Rep Power
    0
    Originally Posted by gw1500se
    While you can disable the button via javascript after it is clicked, if you really want to prevent duplicates, you need to code your PHP to check for that user in the database before inserting it. You can also prevent that by defining the user field as unique in the database.
    Ok thank you for the quick reply. i will try your suggestions. There is a check username fuction in dreamweaver, will that work?
  6. #4
  7. No Profile Picture
    Contributing User
    Devshed Loyal (3000 - 3499 posts)

    Join Date
    Jul 2003
    Posts
    3,383
    Rep Power
    594
    I don't know. I only use Dreamweaver to develop my own code. I was not aware of any direct interface between Dreamweaver and databases.
    There are 10 kinds of people in the world. Those that understand binary and those that don't.

IMN logo majestic logo threadwatch logo seochat tools logo