For a datetime-field:
[cc lang=”MYSQL”]
UPDATE table_name
SET date_column=DATE_FORMAT(date_column,’2016-%m-%d %T’);
[/cc]
For a date-field:
[cc lang=”MYSQL”]
UPDATE table_name
SET date_column=DATE_FORMAT(date_column,’2016-%m-%d’);
[/cc]
[cc lang=”MYSQL”]
UPDATE table_name
SET date_column=DATE_FORMAT(date_column,’2016-%m-%d %T’);
[/cc]
[cc lang=”MYSQL”]
UPDATE table_name
SET date_column=DATE_FORMAT(date_column,’2016-%m-%d’);
[/cc]
..maybe this will change…
Meanwhile, here is a picture of a cat, after losing a battle with a bee.
[ad name=”Adsense – text only”]
That’s it.
If you need more tips, get One Minute Manager from Kenneth H. Blanchard.
Oh, already forgot this article in my drafts:
Since WordPress 3.1, a lot of new cool features were added. One of the most hated loved ones is the admin-bar. In this article I will cover some of the basic hooks to modify it to suit your needs.
Let’s go:
[ad name=”Adsense – text only”]
The developers of WordPress made it really easy for you to disable the admin-bar. Simply go to Users > Your Profile and find the section where it says “Show Admin Bar” and tick your choice.
But this is just saved for each users separately. If you are working on a site for a client and you want to get rid of it for each user, then simply open your theme’s function.php and paste the following code:
[cc lang=”PHP”]add_filter(‘show_admin_bar’,’__return_false’);[/cc]
This will get rid of the admin-bar – if you want to remove the settings in the user profile too, just append this code:
[cc lang=”PHP”]
add_action(‘admin_print_scripts-profile.php’,’hideAdminBar’);
function hideAdminBar(){
echo “
“;
}
[/cc]
By default, the bar shows on top of each page when you are logged in. If you don’t like that, you can hook your own CSS to the admin-bar and move it to the bottom (and do some more crazy stuff with it).
Simply add this code to your functions:
[cc lang=”PHP”]
function adminBarCSS() {
echo ”
“;
}
add_action(‘admin_head’, ‘adminBarCSS’);
add_action(‘wp_head’, ‘adminBarCSS’);
[/cc]
Now it’s up to you to do some more interesting stuff (like moving the bar to the left/right, let it float, or whatever).
If you want to (or need to) remove links in the admin-bar. this small function will help you:
[cc lang=”PHP”]
function myAdminBarRender() {
global $wp_admin_bar;
$wp_admin_bar->remove_menu(‘comments’);
}
add_action( ‘wp_before_admin_bar_render’, ‘myAdminBarRender’ );
[/cc]
The way this works is just to provide the IDs for each link to the [cc lang=”PHP” inline=”1″]remove_menu()[/cc] function.
You can find all default links in /wp-includes/admin-bar.php.
Some of the defaults are:
Here you have a simple way of putting custom links into the admin-bar.
[cc lang=”PHP”]
function myAdminBarRender() {
global $wp_admin_bar;
$wp_admin_bar->add_menu( array(
‘parent’ => ‘new-content’,
‘id’ => ‘new_media’,
‘title’ => __(‘Media’),
‘href’ => admin_url( ‘media-new.php’)
) );
}
add_action( ‘wp_before_admin_bar_render’, ‘myAdminBarRender’ );
[/cc]
You even can create a custom drop down menu in the admin-bar – just take a look at Michael Martins tutorial to get you started.
That’s it for now – now go and pimp your admin-bar! :)