php - Error display after inserting duplicates after unique key is set
伊谢尔伦
伊谢尔伦 2017-05-16 13:06:49
0
4
468

How to change the database error prompt to js?
Use if (insert statement) {echo "<script>alert('This data already exists')</script>"}
insert If the statement encounters a duplicate unique key, it will not return false but directly display a database error

伊谢尔伦
伊谢尔伦

小伙看你根骨奇佳,潜力无限,来学PHP伐。

reply all(4)
左手右手慢动作

try catch I usually set a unique primary key and check to see if there are duplicates before inserting

巴扎黑

insert ignore into ·table· ...plus ignore

迷茫

try catch

曾经蜡笔没有小新

try
{ //...}
catch(Exception $e)
{ //...}

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template