Wordpress update mysql table

前端 未结 4 944
无人共我
无人共我 2021-01-05 02:25

I am writing a plugin for Wordpress, which should check if a mysql entry already exists.
If it does not exist Wordpress should insert the entry into the table. This part

4条回答
  •  太阳男子
    2021-01-05 03:16

    the value of column time must be enclosed with single quote

    $wpdb->query($wpdb->prepare("UPDATE $table_name SET time='$current_timestamp' WHERE userid=$userid"));
    

提交回复
热议问题