Explain me how to run database Query in WordPress?
Submitted by: MuhammadThe $wpdb->query function allows you to execute any SQL query on the WordPress database. It is best to use a more specific function. Check sample code below for SELECT query.
<?php $wpdb->query('query'); ?>// Examples
$wpdb->query( "
UPDATE $wpdb->posts
SET post_parent = 7
WHERE ID = 15
AND post_status = 'static' "
);
Submitted by: Muhammad
<?php $wpdb->query('query'); ?>// Examples
$wpdb->query( "
UPDATE $wpdb->posts
SET post_parent = 7
WHERE ID = 15
AND post_status = 'static' "
);
Submitted by: Muhammad
Read Online WordPress Themes Developer Job Interview Questions And Answers
Top WordPress Themes Developer Questions
☺ | Please explain why widget does not show up in the sidebar? |
☺ | Tell me in what case you don’t see plugin menu? |
☺ | Tell me can WordPress use cookies? |
☺ | Do you know what is the default prefix of wordpress tables? |
☺ | Tell me the ternary conditional operator in PHP language? |
Top Web Developer Categories
☺ | Bootstrap Interview Questions. |
☺ | Front End Web Developer Interview Questions. |
☺ | Typography Interview Questions. |
☺ | Laravel PHP Developer Interview Questions. |
☺ | Junior Developer PHP Interview Questions. |