PHP Check If String Al-ready Exist in Column of Table – Acrosoft

If you want to check string already exist before insert to database then please use this: $checkifstrexist= $mysqli->query(“SELECT * FROM tablename WHERE columnnae=’required string to mactch'”); $num_rows = $checkifstrexist->num_rows; if ($num_rows > 0) { //do this } else { do this }