Auto Production Manufacturing System MySQL Commands
Auto Production Manufacturing System MySQL Commands

How to Write MySQL Commands in WordPress & PHP

MySQL Commands

Here we will show some most important MySQL commands that we need to apply for daily jobs.

MySQL Commands for WordPress

For Database Optimization

  • Revisions Clean: DELETE FROM posts WHERE post_type = ‘revision’
  • Auto Draft Clean: DELETE FROM posts WHERE post_status = ‘auto-draft’
  • Pending Comments Clean: DELETE FROM comments WHERE comment_approved = ‘0’
  • Spam Comments Delete: DELETE FROM comments WHERE comment_approved = ‘spam’
  • Trash Comment Clean: DELETE FROM comments WHERE comment_approved = ‘trash’
  • Trackbacks Clean: DELETE FROM comments WHERE comment_type = ‘trackback’
  • Pingbacks Clean: DELETE FROM comments WHERE comment_type = ‘pingback’
  • Orphan post meta: DELETE pm FROM postmeta pm LEFT JOIN posts wp ON wp.ID = pm.post_id WHERE wp.ID IS NULL
  • Orphan comment meta: DELETE FROM commentmeta WHERE comment_id NOT IN (SELECT comment_id FROM comments)
  • Orphan user meta: DELETE FROM usermeta WHERE user_id NOT IN (SELECT ID FROM users)
  • Orphan Relationships: DELETE FROM term_relationships WHERE term_taxonomy_id=1 & object_id NOT IN (SELECT id FROM posts)
  • Expired Transients:
  • Pending Comments: DELETE FROM comments WHERE comment_approved = ‘0’

Question: Should I delete Trackbacks an Pingbacks comments for Speed and Database optimization?

MySQL Commands for PHP

How to restore files from online to local server. For this, at first login your cpanel. www.yourdomain.com/cpanel. Provide user name and password and login. Generally web folder contain in Public_html folder. So download your web folder under Public_html.

After installing Xampp in local server some files of php.ini need to edit before run it offline.

select * from cuttingproduction where buyerr=’C’ and ordr=’A’;

delete from cuttingproduction where buyerr=’C’ and ordr=’A’;

delete from ordr where ccbuyerr=’C’ and ccordr=’A’;

delete from sizzze where ccbuyerr=’C’ and ccordr=’A’;

delete from colourr where ccbuyerr=’C’ and ccordr=’A’;

delete from lott where ccbuyerr=’C’ and ccordr=’A’;

delete from countryy where ccbuyerr=’C’ and ccordr=’A’;

select * from cuttingproduction where buyerr=’Z’ and ordr in (‘V’,’Z’,’L’,’M’,’W’,’S’,’K’,’B’,’R’,’G’,’N’,’U’,’J’,’X’,’Y’,’A’,’C’,’Q’);

delete from ordr where ccbuyerr=’Z’ and ccordr in (‘V’,’Z’,’L’,’M’,’W’,’S’,’K’,’B’,’R’,’G’,’N’,’U’,’J’,’X’,’Y’,’A’,’C’,’Q’);

delete from colourr where ccbuyerr=’Z’ and ccordr in (‘V’,’Z’,’L’,’M’,’W’,’S’,’K’,’B’,’R’,’G’,’N’,’U’,’J’,’X’,’Y’,’A’,’C’,’Q’);

delete from sizzze where ccbuyerr=’Z’ and ccordr in (‘V’,’Z’,’L’,’M’,’W’,’S’,’K’,’B’,’R’,’G’,’N’,’U’,’J’,’X’,’Y’,’A’,’C’,’Q’);

delete from lott where ccbuyerr=’Z’ and ccordr in (‘V’,’Z’,’L’,’M’,’W’,’S’,’K’,’B’,’R’,’G’,’N’,’U’,’J’,’X’,’Y’,’A’,’C’,’Q’);

delete from countryy where ccbuyerr=’Z’ and ccordr in (‘V’,’Z’,’L’,’M’,’W’,’S’,’K’,’B’,’R’,’G’,’N’,’U’,’J’,’X’,’Y’,’A’,’C’,’Q’);

select * from cuttingproduction where buyerr=’W’ and ordr in (‘I’,’J’,’L’,’M’,’N’,’O’,’P’,’Q’,’R’,’S’,’T’,’V’,’A’,’B’,’C’,’D’,’E’,’F’,’G’,’K’,’U’,’W’);

delete from cuttingproduction where buyerr=’W’ and ordr in (‘I’,’J’,’L’,’M’,’N’,’O’,’P’,’Q’,’R’,’S’,’T’,’V’,’A’,’B’,’C’,’D’,’E’,’F’,’G’,’K’,’U’,’W’);

delete from ordr where ccbuyerr=’W’ and ccordr in (‘I’,’J’,’L’,’M’,’N’,’O’,’P’,’Q’,’R’,’S’,’T’,’V’,’A’,’B’,’C’,’D’,’E’,’F’,’G’,’K’,’U’,’W’);

delete from colourr where ccbuyerr=’W’ and ccordr in (‘I’,’J’,’L’,’M’,’N’,’O’,’P’,’Q’,’R’,’S’,’T’,’V’,’A’,’B’,’C’,’D’,’E’,’F’,’G’,’K’,’U’,’W’);

delete from sizzze where ccbuyerr=’W’ and ccordr in (‘I’,’J’,’L’,’M’,’N’,’O’,’P’,’Q’,’R’,’S’,’T’,’V’,’A’,’B’,’C’,’D’,’E’,’F’,’G’,’K’,’U’,’W’);

delete from lott where ccbuyerr=’W’ and ccordr in (‘I’,’J’,’L’,’M’,’N’,’O’,’P’,’Q’,’R’,’S’,’T’,’V’,’A’,’B’,’C’,’D’,’E’,’F’,’G’,’K’,’U’,’W’);

delete from countryy where ccbuyerr=’W’ and ccordr in (‘I’,’J’,’L’,’M’,’N’,’O’,’P’,’Q’,’R’,’S’,’T’,’V’,’A’,’B’,’C’,’D’,’E’,’F’,’G’,’K’,’U’,’W’);

We also sale

Help Line

Subject URL
WordPress PhpMyadminyoutube.com/watch?v=42fNfYuT2tM

About Engr. Kh. Mashiur Rahman

He is Top Class Digital Marketing Expert in bd based on Google Yahoo Alexa Moz analytics reports. He is open source ERP Implementation Expert for RMG Industry. He is certified IT Professional from Aptech, NCC, New Horizons & Post Graduated from London Metropolitan University (External) in ICT . To Hire his service and Him Email- [email protected], Cell# +880 1792525354

Similar Post

Garments and Textile ERP Developed by Autogarment

Garments and Textile ERP Developed by Autogarment Garments and Textile ERP Developed by Autogarment We …

5 comments

  1. Pingback: Automated Production Tracking Software for Garments | Auto Garment

  2. Pingback: Garments Quality Control Inspection Report Software | Auto Garment

  3. Pingback: Garments Textile ERP Software List | Auto Garment

  4. Pingback: Sewing Output Garment Manufacturing Software | Auto Garment

  5. Pingback: RMG Software Price. Garments ERP Software in Bangladesh – RocketSolutions | Your Trusted It Solutions Provider

Leave a Reply

%d bloggers like this: