SELECT * from product_order WHERE YEAR(order_date) = YEAR(CURRENT_DATE - INTERVAL 1 MONTH) and MONTH(order_date) = MONTH(CURRENT_DATE - INTERVAL 1 MONTH)
Wednesday, 25 April 2018
How to get Last Month's record data from MySQL Database?
SELECT * from product_order WHERE YEAR(order_date) = YEAR(CURRENT_DATE - INTERVAL 1 MONTH) and MONTH(order_date) = MONTH(CURRENT_DATE - INTERVAL 1 MONTH)
Tuesday, 24 April 2018
How to get This Month's record data from MySQL Database?
SELECT * from product_order WHERE MONTH(order_date) = MONTH(NOW()) and YEAR(order_date) = YEAR(NOW())
Monday, 23 April 2018
How to get Last Week's (Monday to Sunday) record data from MySQL Database?
SELECT * from product_order WHERE yearweek((order_date), 1) = yearweek(curdate(), 0)
Sunday, 22 April 2018
Saturday, 21 April 2018
How to get Yesterday's record data from MySQL Database?
SELECT * from product_order WHERE DATE(order_date) = DATE(NOW() - INTERVAL 1 DAY)
Friday, 20 April 2018
How to get Today's record data from MySQL Database?
SELECT * from product_order WHERE DATE(order_date) = DATE(NOW())
Monday, 16 April 2018
How To Create Shortcode In WordPress with parameters?
<?php
### the shortcode code add in theme’s functions.php file ###
// "do_shortcode" but without the wrapping <p> of Shortcodes
function do_shortcode_boc($content) {
$array = array (
'<p>[' => '[',
']</p>' => ']',
']<br />' => ']'
);
$content = strtr($content, $array);
$content = do_shortcode($content);
return $content;
}
function shortcode_shortcodename($atts, $content = null) {
$atts = shortcode_atts(
array(
'title' => '',
'image' => '',
), $atts);
$title = $atts['title'] ? $atts['title'] : '';
$image = $atts['image'] ? $atts['image'] : '';
$str = '<li>
<div class="icon_item">
<img src="'.$image.'">
<p>'.html_entity_decode($title).'</p>
<div class="icon_overlay">
<p>'.do_shortcode($content).'</p>
</div>
</div>
</li>';
return $str;
}
add_shortcode('shortcodename', 'shortcode_shortcodename');
?>
##### Using below code to display shortcode detail #####
[shortcodename title="my title" image="example.jpg"]
<div>
<p> Shortcode content </p>
</div>
[/shortcodename]
##### OR #####
<?php
echo do_shortcode('[shortcodename]');
?>
Subscribe to:
Posts (Atom)