Archive for the ‘MYSQL’ Category

How to Change a Broken WordPress Theme Using PHPMyAdmin

 
Sometimes when editing .php files you will make a mistake and end up breaking your theme or sometimes you might upload a theme that is old and out of date or is just too problematic and it needs to be switched back to the twenty ten default theme.

Some times the following error may occur.

Change a Broken WordPress Theme 1
 
Here is an easy way to switch to the twenty ten default theme using PHPMyAdmin.
 
Step 1
 
Go into your cPanel and look for the Databases section and click on the phpmyadmin link.


 
Step 2
 
Select the database where your WordPress is stored.


 
Step 3
 
Select the ‘wp_options’ table from the menu on the left.

 

Read more »

MySQL database export to pdf using PHP

 
To export whole database or whole table content we can use phpMyAdmin Export option but if you want to export some rows or any query result then we should perform some other way.
 
To create PDF file we should first download the FPDF Library – Click Here.
 
Copy the following code and create a new PHP file called exportpdf.php and paste the content into it or download the file – Click Here
 
Sample Output

Export PDF

Sample Code
 
<?php
require('fpdf.php');
$d=date('d_m_Y');
 

Read more »

How to Delete WordPress Post Revisions To Reduce Database Size

 
It is also made sense to delete and remove all existing stored post revisions and changes made on pages stored in the database in order to reduce the wp_posts table size, especially when there is already tons of revisions or changes been kept. After this operation you can reduce several MB size of your wp_posts table.
 
To view your post revisions, select any post and click edit button then scroll down to bottom of the page.
 
Delete WordPress Post Revisions 1
 

To delete and remove all existing post revisions entries, delete all rows from WordPress database Posts table having post_type value as revision.


Read more »