how to use if not exists while inserting a row mysql

后端 未结 3 2053
我寻月下人不归
我寻月下人不归 2021-01-24 08:17

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 ?

3条回答
  •  情歌与酒
    2021-01-24 09:14

    User Insert Into to ignore duplicates:

    INSERT IGNORE INTO `facebook`
    SET `ID` = null,
    `fb_id` = '". $session['id'] ."',
    `label_id` = '$id',
    `page_ids`='',
    `token`='". $access_token ."';
    

提交回复
热议问题