admin管理员组文章数量:1023204
I am trying to update my sql data through $wpdb, but can't... If anyone can help what's the real issue?
$updated_version = $wpdb->update('wp_visitors', array('views' => $updated), array( '%d' ));
I am trying to update my sql data through $wpdb, but can't... If anyone can help what's the real issue?
$updated_version = $wpdb->update('wp_visitors', array('views' => $updated), array( '%d' ));
Share
Improve this question
asked May 1, 2019 at 4:12
Musaf HanifMusaf Hanif
11 bronze badge
1 Answer
Reset to default 1You're missing your where statement. You need to tell wpdb
which row it should be updating, otherwise you're looking to insert rather than update.
From the $wpdb::update Codex:
wpdb->update( string $table, array $data, array $where, array|string $format = null, array|string $where_format = null );
I am trying to update my sql data through $wpdb, but can't... If anyone can help what's the real issue?
$updated_version = $wpdb->update('wp_visitors', array('views' => $updated), array( '%d' ));
I am trying to update my sql data through $wpdb, but can't... If anyone can help what's the real issue?
$updated_version = $wpdb->update('wp_visitors', array('views' => $updated), array( '%d' ));
Share
Improve this question
asked May 1, 2019 at 4:12
Musaf HanifMusaf Hanif
11 bronze badge
1 Answer
Reset to default 1You're missing your where statement. You need to tell wpdb
which row it should be updating, otherwise you're looking to insert rather than update.
From the $wpdb::update Codex:
wpdb->update( string $table, array $data, array $where, array|string $format = null, array|string $where_format = null );
本文标签: phpI can39t update my data through wpdb
版权声明:本文标题:php - I can't update my data through $wpdb 内容由热心网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://it.en369.cn/questions/1745536410a2154981.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论