In this video session i have explained about,
1. Update data of wordpress table in wordpress, 2. Delete data from wordpress table in wordpress
#WordpressTutorialsPoint
#WordpressLearnersHub
#WordpressCustomizations
#LearnWordpressStepbyStep
#WordpressBySanjay
All we have seen in 2 different ways by using core function as well as by running direct query.
Steps to do Update data of Wordpress table:
#1: wpdb::update( string $table, array $data, array $where, array|string $format = null, array|string $where_format = null )
#2: wpdb::query and wpdb::prepare
Steps to do Delete data from Wordpress table:
#1: wpdb::delete( string $table, array $where, array|string $where_format = null )
#2: wpdb::query and wpdb::prepare
By Step $wpdb::update,
===============
1. wpdb::update( ‘table’, array( ‘column’ = ‘foo’, ‘field’ = ‘bar’ ), array( ‘ID’ = 1 ) )
2. wpdb::update( ‘table’, array( ‘column’ = ‘foo’, ‘field’ = 1337 ), array( ‘ID’ = 1 ), array( ‘%s’, ‘%d’ ), array( ‘%d’ ) )
‘table’: table_name of wordpress database
By Step $wpdb::delete,
===============
1. wpdb::delete( ‘table’, array( ‘ID’ = 1 ) )
2. wpdb::delete( ‘table’, array( ‘ID’ = 1 ), array( ‘%d’ ) )
‘table’: table_name of wordpress database
By Step $wpdb::query,
=================
We have to use $wpdb::prepare to make Safe Execution of MySql Query
$wpdb-query(
$wpdb-prepare(
"Update wp_custom_plugin set email = '%s' where id = %d",'[email protected]',4
)
);
$wpdb-query(
$wpdb-prepare(
"Delete from wp_custom_plugin where id = %d",4
)
);
An array of formats to be mapped to each of the value in $data. If string, that format will be used for all of the values in $data. A format is one of '%d', '%f', '%s' (integer, float, string).
Documenation Study Notes:
===============
https://developer.wordpress.org/refer...
https://developer.wordpress.org/refer...
https://developer.wordpress.org/refer...
Create database table dynamically by Wordpress Plugin,
===============
Click here to watch: • Wordpress Plugin Development tutorial...
How we add custom javascript code to wordpress plugin page:
==============================
Click here to watch: • Wordpress Plugin Development tutorial...
SOCIAL :
===============
Subscribe : / @onlinewebtutor
FACEBOOK : / onlinewebtutorhub
TWITTER: / owthub
BLOG: https://onlinewebtutorhub.blogspot.in/
RECOMMENDATION:
===============
1. Some knowledge of PHP, HTML for this video series
2. How to Install Wordpress: • Wordpress Theme Development tutorial ...
Also you can learn Wordpress Custom
===============
Theme Development: • Wordpress Theme Development tutorial ...
Widget Development: • Wordpress Widget Development tutorial...
Tags
===============
online web tutor,
profotech solutions,
wordpress plugin development from scratch in hindi,
wordpress plugin development from scratch in easy steps,
wordpress plugin development,
wordpress plugin development in easy steps,
plugin development in wordpress from scratch in hindi,
plugin development in wordpress by online web tutor,
plugin development in wordpress tutorials from scratch in hindi,
plugin theme development tutorials in hindi,
plugin development tutorials in hindi,
owt tuts,
online web tutorials,
Thanks
Online Web Tutor
Keep learning and Sharing :)
~-~~-~~~-~~-~
Please watch: "Learn backbone.js tutorial from scratch"
• Learn backbone.js tutorial from scrat...
~-~~-~~~-~~-~