Check if value exists before inserting into MySQL DB in a PHP script

后端 未结 1 1604
温柔的废话
温柔的废话 2020-11-29 13:32

I\'ve looked for similar questions with no success.

I have this piece of code:

form1.php

$query  = \"INSERT INTO table1 \";
         


        
相关标签:
1条回答
  • 2020-11-29 14:08

    Create a UNIQUE key on the fields you care about, and detect the integrity error after the fact.

    0 讨论(0)
提交回复
热议问题