The thing that i want to do is to check if there is a same row and if not to insert a new row to the table.
In that case, how can i use if not exists ?
if not exists
You can use the INSERT IGNORE INTO ... syntax. When using this, duplicate key errors are treated as warnings and the statement will return without having inserted the affected row.
INSERT IGNORE INTO ...