8 Useful WordPress SQL statement 2014


In the past decade, MySQL database has become popular, and WordPress blog using a MySQL database, although the use of plug-ins can solve some problems, but to achieve some special tasks, execute SQL statements in phpMyAdmin is the most concise way, here is a useful summary of eight WordPress system SQL statements used to solve some practical problems encountered.

1. create a backup of the database

  Backup of the database is the first thing to do, just by following a simple method you can back up the database:

  After login phpMyAdmin. Choose your WordPress database, and then click on the "Export" button, select a compression method (you can use gzip) and click the "Go" button, when the browser when prompted to download, click "Yes", download the file to the database locally.
 
2. bulk delete articles Amendment

  WordPress2.6 later version adds a Post revisions feature, though some use, but the article is amended to increase the size of your database, we can choose to bulk delete.

  After logging in phpMyAdmin execute the following SQL statement to bulk delete.

DELETE FROM wp_posts WHERE post_type = "revision";

3. batch delete spam comments

  A true story is that one of my friends set up a blog on the Internet, there are times he spent a few days on vacation, no Internet, and when he came back, log in to your blog, saw more than 5000 comments Wait audit, of course, most of them are spam comments to manually delete these comments to spend a lot of time, so we can use the following approach.

  Execute the following SQL statement after login phpMyAdmin.

DELETE from wp_comments WHERE comment_approved = '0';

  Be careful, though this solution is useful for processing millions of ordinary garbage, but will remove comments without approval, so it is best to install or use Akismet to fight comment spam.
 
4. modify article properties

  After you install WordPress, admin account is created, a lot of people are wrong to use this account to write a blog, until they realize that this is not a personal account.

  The solution, each article to modify the properties need a lot of time, the following SQL statement can help you quickly complete this function.

  First you have to find your correct user name, use the following SQL statements can be found in your user ID number.

SELECT ID, display_name FROM wp_users;

  Assuming that this ID is NEW_AUTHOR_ID, and administrator admin ID for
OLD_AUTHOR_ID, then run the following SQL statement.

UPDATE wp_posts SET post_author = NEW_AUTHOR_ID WHERE post_author = OLD_AUTHOR_ID;

5.Manual Reset Password

  A lot of people in order to protect their own blog not being hacked, using a very complex password, although this is a good thing, but often forgotten administrator password things will happen.

  Of course, you can send to your WordPress link to reset your password via e-mail, but if you can not access your e-mail address, then had to use the following SQL statement to reset your password.

UPDATE wp_users SET user_pass = MD5 ('PASSWORD') WHERE wp_users.user_login = 'admin' LIMIT 1;

  MD5 hash function is a built-in MySQL for converting password hashes.

6.change WordPress domain

  Sometimes you may want to change your blog's domain name, but WordPress will put your name stored in the database, so you have to use the following SQL statement to modify.

UPDATE wp_options SET option_value = replace (option_value, 'http://www.oldsite.com', 'http://www.newsite.com') WHERE option_name = 'home' OR option_name = 'siteurl';

  Then, you have to use the following SQL GUID of the article will also be modified.

UPDATE wp_posts SET guid = replace (guid, 'http: //www.oldsite.com','http: //www.newsite.com');

  Finally, use the following statement will replace the article all the old domain to the new domain name.

UPDATE wp_posts SET post_content = replace (post_content, 'http://www.oldsite.com', 'http://www.newsite.com');

7. showing the number of SQL queries

  You have something to blog in performance when the number of queries the database learned is very important, in order to reduce database query, we need to know on one page in the end how many queries.

  This time, do not need to log in phpMyAdmin, you only need to modify the footer.php file, at the end of the file add the following lines of code.

<? PHP if (is_user_logged_in ()) {?>  
    <? PHP echo get_num_queries ();?> queries in <PHP timer_stop (1);??> seconds.  
<PHP?}?>


8.restore your WordPress database

  When your database for some reason (hacking or upgrade error) is damaged or lost, if you have a backup, then you can restore your WordPress database.

  Sign in phpMyAdmin, select your WordPress database, click "Import" button, click "Browse" button, then "Run" button to import the database from your hard drive to select the backup file, point.

  If all goes well, your WordPress functions will return to normal.

Wordpress Database Optimization Tips 2014 August

Wordpress database optimization tips 2014 august

WordPress system uses a long time, the database will be a lot of redundant data regularly Wordpress database optimization and cleanup, Wordpress can guarantee fast work.

  First, disable some useless plugins, WordPress system table data tables outside are removed, leaving only wp_posts, wp_comments, wp_terms, wp_term_relationships, wp_term_taxonomy and other system data tables.

  Secondly, open phpMyadmin, redundant data via SQL statement delete operation. Remember to backup before deleting it.

  Delete the script is:

  DELETE FROM wp_posts WHERE post_type = 'revision';

  DELETE FROM wp_postmeta WHERE meta_key = '_edit_lock';

  DELETE FROM wp_postmeta WHERE meta_key = '_edit_last';

  Finally, in phpMyAdmin, select all tables, click "optimize table."

  After this some optimize operations, it can be WordPress database delete redundant data to optimize the performance of the database.

Drop Down Menu With Pure CSS

Direct code:

HTML

<div id="navtre">
<ul class="levl-one">
<li><a href="/about/" title="about">about</a></li>
<li><a href="/contact/" title="contact">contact</a></li>
<li><a href="/feeds/latest/" title="subscribe">subscribe</a></li>
<li><a href="/Test1/" title="Test1page">Test1</a>
  <ul class="level-two">
    <li><a href="/Test1/testsub/" title="test1subpage">Test1sub</a></li>
  </ul>
</li>
<li><a href="/Test2/" title="Test2 page">Test2</a>
  <ul class="levl-two">
    <li><a href="/Test2/subpage2/" title="Testsubpage2">Testsubpage2</a></li>
</ul></li>

</ul>
</div>

CSS

levl-one {display: inline; position: relative; }

.levl-one {display: none; position: absolute; left: 0; top: 1em; /* adjust as necessary */ }

.levl-one:hover .levl-two {display: block; }

Easy Ways to Speed Up Your Android Mobiles in Under 3 Minutes

1. Clear Your App Cache (30 seconds)

Over time, your programs write to the app cache on your phone and eat up precious system resources while slowing everything down. You can clear the cache on any individual app by visiting its property page in the Settings menu and tapping the clear cache button, but with dozens of apps on most phones, it could take an eternity to do this manually.

Clear Cache Settings
App Cache Cleaner, a free app, makes it easy to delete the cache on all your apps at once with just a couple of taps. After installing and launch App Cache Cleaner, simply tap Clear All and you’re done.
Cache Cleaner
Of course, the cache will fill  up again over time, and you’ll want to delete it again. App Cache Cleaner has an Auto Clear feature. If you enter its settings menu, tap Auto Clear Interval and select a duration, it will automatically clear the cache on a regular basis. However, this means that the app needs to run in the background.
Auto Clear Interval in App Cache Cleaner
 Installing and using App Cache Cleaner for the first time should take around 30 seconds.

2. Disable or Uninstall Unused Apps (60 seconds)

You may not know it, but many of the apps you never even use may be running in the background, eating up precious system resources. From the app that you tried for 5 minutes last month to the shopping app that came preloaded on your phone, every unused app has the potential to weigh your phone down. It’s easy to uninstall apps you’ve downloaded yourself, but crapware is a little harder to dispose of.
If you have rooted your phone, you can completely remove every trace of your preloaded apps. If not, you can still disable those apps through the settings menu. It should take about 10 seconds to uninstall or disable each app you don’t want. It should take you approximately one minute to get rid of 6 apps, longer if you have more crapware to dump.
MORE: How to Remove Android Crapware

3. Install a New App Launcher (30 seconds)

Your phone’s app launcher controls your desktop, lock screen apps menu, and other critical parts of the UI. Though every Android phone comes with its own preloaded app launcher, you can install a third party launcher that will not only change the look and feel of your device, but also speed the time it takes it to navigate around the OS. There are many different launchers available in the app store, but we found Lightning Launcher Home to be among the fastest and easiest to use.
To use Lightning Launcher or another launcher of your choice:
  1. Install Lightning Launcher from the Google Play store.
  2. Tap the Home Button. A menu appears asking you which launcher you want.
  3. Select Lightning Launcher and Tap Always.
     Set to Lightning Launcher and Select Always
Downloading the Lightning Launcher, and setting it to run as your default should take 30 seconds.

4. Remove Unnecessary Widgets and Shortcuts (30 seconds)

Even with a speedy App Launcher installed, your phone will use more memory the more widgets and shortcuts it has in memory. Look through your desktops for widgets you don’t absolutely need and remove them by long pressing and dragging them off screen.
Remove a Widget
A number of phones with widgets that advertise services such as media stores or news services. Unless you really want to look at a list of hot YouTube videos or Google Play Books on your home screen every day, remove these.
Dragging half a dozen shortcuts and widgets off  of your desktops should take 30 seconds.

5. Limit or Disable Background Data (10 to 60 seconds)

Your email, your Gmail, your Facebook, your Twitter and your backup app all want to ping the Internet for data on a regular basis. All that syncing not only eats up your battery, but also takes up system resources and slows your device down.
There are some services you may want to sync in real time, but there are others you can check manually. For example, if you don’t need to be alerted the moment you get a Facebook mention or receive an email to your personal account, you can prevent those from connecting in the background.
To disable background data for all apps:
  1. Navigate to Settings.
  2. Tap Data usage.
    Select Data Usage 
  3. Launch the context menu by tapping the three dots in the upper left corner of the screen or hitting the menu button (on Samsung and LG phones).
    Select Data Usage
  4. Toggle Autosync data to off and tap Ok on the warning that comes up.
    Select Autosync Data
To disable background data for Gmail, Google+ and other Google Services:
  1. Navigate to Settings. You can get to the Android settings menu from the notification drawer or apps menu.
  2. Tap on Google under accounts.
    Tap the Account You Want to Stop From Syncing 
  3. Tap the account name.  If the sync icon next to the account name is green, it has sync permission. If it is gray, syncing is already disabled.
    Select Your Gmail account
  4. Toggle all types of data syncing to off, including email, contacts and calendar.
    Toggle Sync to Off 
To turn off background data in other apps such as Facebook or the standalone email client,  you must go directly into their settings’ menus and find the option to never update or update manually. Disabling all your background at once should take just 10 seconds, but if you want to manually disable Gmail, Facebook and email client autosync separately, this process could take as long as a  minute.
Depending on how many apps you need to uninstall and services you wish to disable, you could finish speeding up your phone in as little as 2 minutes and 40 seconds. That’s a very small time investment to make your smartphone snappier.

Windows 8 Error Codes and Solutions


You may not optimize windows 8 if you consistently experience errors in your operating system. However, it is a new operating system so chances are there to get surprised with errors. Do not get obsessed, here are bunch of common errors and their solution:

Fix-Windows8-Errors-Solutions


Error code 0xc00000e9

Solution:
While upgrading from Win 7 to Win 8, you may encounter Error code 0xc00000e9
Try following steps to get this error fixed
  1. You may encounter, if you have removed a removable storage device while it is working.
  2. Click on start button and type “cmd”. Type C: it will be shown like this C:\>, if not type cd.. to get out of the directory until you reached C:\>. Now type chkdsk/r
  3. go to manufacturer’s website and update BIOS
  4. Revert back to settings prior the error

Error code 0x00005D

Solution:
If you are trying to install windows 8 and put bootable disc in it but get this error code 0x00005D and it prompts you to restart your pc. Even then problem persists. Following are the reasons:
  1. Windows 8 OS DVD
  2. System does not support windows 8
  3. System is not configured up to windows 8 minimum hardware requirements
  4. Windows 8 setup has some corrupt files
  5. Any hardware failure or internal error
You can install windows 8 after resolving these issues.

Error Code 0xc0000001
 Solution:
There is no need to freak out to see this error. You can fix it in a quick and easy way.
If you are experiencing Code: 0xc0000001 warning message, then follow the steps as given below to get rid of it.
  1. Shutdown your system
  2. Start your pc, as logo screen appeared press SHIFT and f8 key immediately and it will take you to Recovery and then select See advanced repair option
  3. Locate Choose an Options click Troubleshoot
  4. Click Advanced Options and click Windows Startup Settings
  5. Now click Restart. It will repair without any changes in in your files and folders.
If problem, persist then following tips would be helpful
  1. Replace or insert disc / USB in appropriate place
  2. Forcefully restart your computer by pressing (ALT+CTRL+DEL)
  3. Let your system automatically repair and you just hold on.

Error Code 0x800F0906

Solution:
While installing Microsoft dot net framework 3.5 on windows 8, you may encounter Error Code 0x800F0906. Usually we came across this issue because of network proxy, firewalls. To resolve issue you can try following steps.
  1. Go to desktop and open My Computer
  2. Insert installation media and right click on windows 8 client ISO
  3. Click Start on taskbar and type cmd
  4. Type Dism/online/enable-feature/featurename:NetFx3/All/Source:<drive>:\sources\sxs/LimitedAccess and press Enter
  5. Eject windows 8 media and install windows live component
  6. Go to Start button click All programs and click Windows Update
  7. Restart you pc and install Microsoft dot net framework 3.5.
www.comhttp.blogspot.in. Powered by Blogger.