[Solved] How to cancel action when detect same line in MySQL [closed]


from my understanding of your question – in your php code you can do something like this

<?php
$con=mysqli_connect("localhost","my_user","my_password","my_db");
$sqlSearch = "select everything from <table_name> where <column_name> = <value>;";
$result = mysqli_query($con,$sqlSearch );
if (mysqli_num_rows($result) > 0){
// do nothing
}
else{
$sqlInsert = "insert into <table_name> (column1,column2...) VALUES(value1,value2...);";
$result = mysqli_query($con,$sqlInsert);
}


?>

basically, you want to search the database to see if that row exist and if it does not you want to perform an insert query.

solved How to cancel action when detect same line in MySQL [closed]