How to Fix Unexpected WordPress Database Table Error

On March 6, 2009, in Wordpress, by Yao Yuan

Two days ago, out of nowhere, a particular table in the WordPress in hongkiat.com went corrupted. The ‘wp_comments‘ table of the WordPress database just crashed without signs, warnings nor error messages. So how did I came to know? Here are the symptoms: If you try to back up your database, you’ll be thrown with this [...]

Two days ago, out of nowhere, a particular table in the WordPress in hongkiat.com went corrupted. The ‘wp_comments‘ table of the WordPress database just crashed without signs, warnings nor error messages. So how did I came to know? Here are the symptoms:

  • If you try to back up your database, you’ll be thrown with this error message – wp_comments is marked as crashed and should be repaired when using LOCK TABLES
  • Recent comments widget appears blank.
  • Top commenter widget appears blank.
  • Comment posted will not be written into DB, therefore will not be shown.
  • Comments section in WP Admin appears to have zero records.

After searching the Internet high and low in hoping to find similar cases to help me identify and fix the problem, I end up with nothing. So I tried it my way and luckily enough, I managed to solved it. I thought writing the entry out will not only help those who suffered the same, also keep myself reminded just in case I hit on this error again in the future.

The fix / Solution

To fix this, you must have access to the wordpress database, either via PhpMyAdmin or Secure Shell (SSH). Most shared hosting account comes with phpMyAdmin, but either option you should be extremely careful because you dealing with the database. Any wrong move will cause more data lost.

PhpMyAdmin

phpmyadmin-fix.gif

In PhpMyadmin, select the WordPress database and look for the error table. In my case, the ‘wp_comments‘ table. Check it, and scroll all the way down and look for ‘With selected‘ drop-down box. Select Repair table and things should be alright.

Secure Shell

SSH fix

  1. Login to your shell
  2. Enter ‘mysql -u username -p database_name‘ to access databases
  3. Enter ’show databases;’ to view all databases
  4. Enter ‘use database_name;‘ to engage the database
  5. Enter ‘show tables;‘ to show all tables within the database
  6. Enter ‘check table wordpress_table_name‘ to verify this is the corrupted table
  7. Fix it with ‘repair table wordpress_table_name
  8. Enter ‘check table wordpress_table_name‘ again to make sure it’s fixed

Step 3 and 5 are not necessary if you are familiar with your databases and tables. Hope this helps.

Tagged with:  

WordPress Theme That Mimics Mac OS X Leopard – Leopress

On March 6, 2009, in Wordpress, by Yao Yuan

here’s the WordPress theme that gets very close to a Mac OS X Leopard – Leopress. Leopress tries to look like the Mac’s Finder, and I think it’s pretty close. One good reason why you will want to use WordPress themes that mimic other interface is – it kinda camouflage your blogging activity, hiding them [...]

leopress

here’s the WordPress theme that gets very close to a Mac OS X Leopard – Leopress. Leopress tries to look like the Mac’s Finder, and I think it’s pretty close. One good reason why you will want to use WordPress themes that mimic other interface is – it kinda camouflage your blogging activity, hiding them from bosses or superiors who passes by.

View demo | Download Leopress

Tagged with:  

Widgetize non-widget WordPress theme

On March 6, 2009, in Wordpress, by Yao Yuan

Consider this – If you found a WordPress theme that you like so much but it is not widget-supported, don’t give up just yet. Methods below helps you to widgetize non-widget theme to a drag-drop widget theme. Download Widget plugin from Automattic, upload them accordingly and follow the 2 steps below. Step 1 Look for [...]

widgetize non widget theme
Consider this – If you found a WordPress theme that you like so much but it is not widget-supported, don’t give up just yet. Methods below helps you to widgetize non-widget theme to a drag-drop widget theme. Download Widget plugin from Automattic, upload them accordingly and follow the 2 steps below.

Step 1

Look for functions.php (Create one if you don’t have). Insert the following code into it, save and close. We are done with functions.php. Basically what this codes does is – it register the sidebar as dynamic.

<?php
if ( function_exists(’register_sidebar’) )
register_sidebar();
?>

Step 2

Here’s how a typical sidebar.php will look like.

<div id=”sidebar”>
<h2>Search this site</h2>
<div id=”searchdiv”>
<form id=”searchform” method=”get” action=”<?php echo $_SERVER['PHP_SELF']; ?>”>
<input type=”text” name=”s” id=”s” size=”20″/>
<input name=”sbutt” type=”submit” value=”Go” alt=”Submit” />
</form>
</div>
<h2><?php _e(’Archives’); ?></h2>
<ul><?php wp_get_archives(’type=monthly’); ?></ul>
<h2><?php _e(’Categories’); ?></h2>
<ul><?php list_cats() ?></ul>
<h2><?php _e(’Meta’); ?></h2>
<ul>
<?php wp_register(); ?>
<li><a href=”<?php bloginfo(’rss2_url’); ?>”>RSS</a></li>
<li><?php wp_loginout(); ?></li>
</ul>
<?php wp_meta(); ?>
</div>

What you need to do here is to enclose an an-if statement into sidebar.php. The addition of codes are in bold.

<div id=”sidebar”>
<h2>Search this site</h2>
<div id=”searchdiv”>
<form id=”searchform” method=”get” action=”<?php echo $_SERVER['PHP_SELF']; ?>”>
<input type=”text” name=”s” id=”s” size=”20″/>
<input name=”sbutt” type=”submit” value=”Go” alt=”Submit” />
</form>
</div>
//
<?php if ( !function_exists(’dynamic_sidebar’)
|| !dynamic_sidebar() ) : ?> // added

//
<h2><?php _e(’Archives’); ?></h2>
<ul><?php wp_get_archives(’type=monthly’); ?></ul>
<h2><?php _e(’Categories’); ?></h2>
<ul><?php list_cats() ?></ul>
<h2><?php _e(’Meta’); ?></h2>
<ul>
<?php wp_register(); ?>
<li><a href=”<?php bloginfo(’rss2_url’); ?>”>RSS</a></li>
<li><?php wp_loginout(); ?></li>
</ul>
<?php wp_meta(); ?>
//
<?php endif; ?> // added
//
</div>

That’s it. The theme now is now widgetized. You can now do the drag-drops like the widget themes. Here’s a goodWordPress widget resource.

Tagged with:  

Execute PHP in WordPress post, page and Widget Sidebar

On March 6, 2009, in Wordpress, by Yao Yuan

If you are still struggling on how to insert PHP Codes inside particular blog post, page or a widget sidebar for execution; the following tutorial is for you. Executing PHP codes in WordPress Page/Post Installation Download phpexec.txt Rename phpexec.txt to phpexec.php Upload to /wp-content/plugins/ directory Activate the plug-in from WordPress administration menu Usage Anywhere in [...]

If you are still struggling on how to insert PHP Codes inside particular blog post, page or a widget sidebar for execution; the following tutorial is for you.

Executing PHP codes in WordPress Page/Post

Installation

  1. Download phpexec.txt
  2. Rename phpexec.txt to phpexec.php
  3. Upload to /wp-content/plugins/ directory
  4. Activate the plug-in from WordPress administration menu

Usage

Anywhere in your post/pages where you want to execute a PHP Codes, insert <phpcode> before your php codes and </phpcode> your php codes.

<phpcode>
	<?php
		echo "Current date and time: ";
		echo date("l dS of F Y h:i:s A");
	?>
</phpcode>

Security

If you are running a blog with multiple users, you need to determine who can run this plug-in. Alter the settings in your Administration Menu. Options -> PHPExec

Executing PHP codes in WordPress widget sidebar

Installation

  1. Download execphp.txt
  2. Rename execphp.txt to execphp.php
  3. Upload to /wp-content/plugins/ directory
  4. Activate the plug-in from WordPress administration menu

Usage

This plug-in work like a normal text widget except that it allows execution of PHP Codes. You can create up to 9 instances of this widget.

Tagged with:  

Something Useful for creating a WordPress theme

On March 6, 2009, in Wordpress, by Yao Yuan

people wanting to know how to create a WordPress theme. Here’s some resources I’ve found useful for putting one together: Graphic design: Useful to have: Photoshop/Fireworks or the like to create your graphics For inspiration: sites like Netdiver, Design Melt Down, CSS Beauty, Unmatched Style etc can help sometimes. Color scheme ideas: Colorschemer, Daily Color [...]

people wanting to know how to create a WordPress theme. Here’s some resources I’ve found useful for putting one together:

  • Graphic design:
    • Useful to have: Photoshop/Fireworks or the like to create your graphics
    • For inspiration: sites like Netdiver, Design Melt Down, CSS Beauty, Unmatched Style etc can help sometimes.
    • Color scheme ideas: Colorschemer, Daily Color Scheme and Flickr (photos are a brilliant source for color combinations). Flip through your favourite magazines (I love looking through my How Magazines and books for ideas. Look at how you’ve designed your house/bedroom/office – what color combinations do you like?
    • Fonts: DaFont for free fonts and Linotype for purchasing professional fonts.
    • Images: SXC for free photos and iStockPhoto for inexpensive illustrations and photos.
  • XHTML/CSS templating:
  • Understanding how WordPress themes are put together. I can’t emphasise enough how important the WordPress manual is. Don’t miss the Stepping into templates information.
  • Understanding “the loop” and various WordPress tags.
  • Knowing when and how to install plugins. WP-Plugins.net has many plugins, but doing a Google or delicious search for “Wordpress plugin” and then the type of plugin you’re wanting will help you find many others.
  • Knowing at least a little bit of PHP if you don’t want to feel so scared by WordPress tags, the loop, plugins and your templates. There’s some tutorials on W3Schools which can help.

Have you found any others which you find essential?

Tagged with:  

2 interesting code

On March 4, 2009, in Tips & Skills, by Yao Yuan

code 1 javascript:document.body.contentEditable=’true’; document.designMode=’on’; void 0 input this in your url bar, then you can edit the website you are viewing. code 2 javascript:document.body.contentEditable=’false’; void 0 exit

code 1
javascript:document.body.contentEditable='true'; document.designMode='on'; void 0

input this in your url bar, then you can edit the website you are viewing.
code 2

javascript:document.body.contentEditable='false'; void 0

exit

Tagged with:  

Bitdefender 9,10 activation code for free

On March 2, 2009, in All for Free, by Yao Yuan

(Internet Security 2008) activation code: D6CD43667B2E56BD7D10 F5FB27987FF6A926D3A4 BC79FEAF086844F21913 0C29107D9ED1B985EF1B (AntiVirus Security 2008) activation code:5B389228049A156899AF E7BD554B5A7156792F36 66EE85E3672BC0F0776D B06C49D4C3060ED08040 Total Security 2008 activation code: 57E683ECF07BAA56B7F0 68CE6485F3C946D1FEFC 664D2A35D28FA0F7DDA1 74D3F71A3754881D3241 Bitdefender 9 Family (Internet Security 9) activation code:9B501-5F6A1-E804A-DBFB2 7E015-0D871-E6773-902A7 (Professional 9) C883F-918AF-1B2F9-31B86 8AB75-B93C7-D7C2B-87C1A Bitdefender 10 Family(Internet Security 10) activation code:1CF8405B3C66078A437C 8107CA7590D58FB2B0FB (Antivirus Plus 10) AEAC327DD6632EA1A89B D29D3ADB10A14E2A5840

(Internet Security 2008) activation code: D6CD43667B2E56BD7D10 F5FB27987FF6A926D3A4 BC79FEAF086844F21913 0C29107D9ED1B985EF1B

(AntiVirus Security 2008) activation code:5B389228049A156899AF E7BD554B5A7156792F36 66EE85E3672BC0F0776D B06C49D4C3060ED08040

Total Security 2008 activation code: 57E683ECF07BAA56B7F0 68CE6485F3C946D1FEFC 664D2A35D28FA0F7DDA1 74D3F71A3754881D3241

Bitdefender 9 Family (Internet Security 9) activation code:9B501-5F6A1-E804A-DBFB2 7E015-0D871-E6773-902A7 (Professional 9) C883F-918AF-1B2F9-31B86 8AB75-B93C7-D7C2B-87C1A

Bitdefender 10 Family(Internet Security 10) activation code:1CF8405B3C66078A437C 8107CA7590D58FB2B0FB (Antivirus Plus 10) AEAC327DD6632EA1A89B D29D3ADB10A14E2A5840

Tagged with:  
Tagged with:  

Introduce Friends to the NetBeans IDE, Get a 2GB USB Drive!

On February 20, 2009, in All for Free, by Yao Yuan

NetBeans Refer-a-Friend Promotion Introduce Friends to the NetBeans IDE, Get a 2GB USB Drive! The NetBeans IDE has always enjoyed word-of-mouth success—developers tell their friends about how the tool has radically improved their development experience, and then recommend that their friends give the IDE a try. We want you as a new user to be [...]

NetBeans Refer-a-Friend Promotion

Introduce Friends to the NetBeans IDE, Get a 2GB USB Drive!

The NetBeans IDE has always enjoyed word-of-mouth success—developers tell their friends about how the tool has radically improved their development experience, and then recommend that their friends give the IDE a try. We want you as a new user to be a part of this movement. The good news is: we will reward you for it!

Tell your friends about the NetBeans IDE, and if they download the IDE as a result we send you a 2GB USB drive preloaded with selected NetBeans Documentation, as well as OpenOffice, Sun’s free and popular productivity suite!

Spread the word today about the NetBeans IDE and claim your gift!
http://www.netbeans.org/competition/refer-a-friend/index.html

Tagged with:  

Evocation

On February 19, 2009, in YaoYuan, by Yao Yuan

This is a translation of a chinese song, i really love this song, it’s so blue. But i think i am not good translator…

This is a translation of a chinese song, i really love this song, it’s so blue.

But i think i am not good translator…

Continue reading »

Tagged with:  
Page 13 of 23« First...1112131415...20...Last »

You may interested this