Mysql inserts the following values. Why do you prompt for duplicate inserts?

backend PHP sends the submitted data to Filter
submit data: "> < script > alert ("1") < / script >

Filter (equivalent to conversion via htmlspecialchars): "> < script > alert ("1") < / script >

name varchar (255)
description text

clipboard.png

prompt: Error: Duplicate entry"> < script > alert ("1") < / script > "for key" name"

Mar.02,2021

name is the primary key?


means there is data


  • maybe your name field has set a unique index:

check the table index:
show index from your_table_name
mainly depends on whether the Non_ Unique value is 0

  • maybe your NAME is the keyword, so you'd better use NAME to cause
.

it is possible that these two fields have a unique index that caused the insertion failure. Take a look at the index

.
Menu