Title: allgood's Replies | WordPress.org

---

# allgood

  [  ](https://wordpress.org/support/users/allgood/)

 *   [Profile](https://wordpress.org/support/users/allgood/)
 *   [Topics Started](https://wordpress.org/support/users/allgood/topics/)
 *   [Replies Created](https://wordpress.org/support/users/allgood/replies/)
 *   [Reviews Written](https://wordpress.org/support/users/allgood/reviews/)
 *   [Topics Replied To](https://wordpress.org/support/users/allgood/replied-to/)
 *   [Engagements](https://wordpress.org/support/users/allgood/engagements/)
 *   [Favorites](https://wordpress.org/support/users/allgood/favorites/)

 Search replies:

## Forum Replies Created

Viewing 2 replies - 1 through 2 (of 2 total)

 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [Plugin development, install](https://wordpress.org/support/topic/plugin-development-install/)
 *  [allgood](https://wordpress.org/support/users/allgood/)
 * (@allgood)
 * [16 years, 5 months ago](https://wordpress.org/support/topic/plugin-development-install/#post-1184832)
 * You need to wrap the above code with the following if statement…
 *     ```
       if(!function_exists("rb_install")){
           function rb_install() {
       	global $wpdb;
   
       	//first check to see if the DB table already exists
       	$tableName = $wpdb->prefix . "rusty_beard";
   
       	if($wpdb->getvar("SHOW TABLES LIKE '" . $tableName . "'") != $tableName) {
       		//create DB tables
       		$install = "CREATE TABLE " . $tableName . "(
       				field_id  KEY INT NOT NULL AUTO_INCREMENT,
       				field_name VARCHAR(50),
       				field_type VARCHAR(50),
       				field_default VARCHAR(240),
       				field_required INT,
       				field_label VARCHAR(240)
       				field_order INT)";
   
       		require_once(ABSPATH . 'wp-admin/includes/upgrade.php');
   
       		dbDelta($install);
   
       		//add version to DB
       		add_option("rb_version", $rbVersion);
   
       	}
           }
   
           //install the plugin
           register_activation_hook(__FILE__, 'rb_install');
       }
       ```
   
 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [Can’t edit my old (backuped) posts (404 error)](https://wordpress.org/support/topic/cant-edit-my-old-backuped-posts-404-error/)
 *  [allgood](https://wordpress.org/support/users/allgood/)
 * (@allgood)
 * [16 years, 6 months ago](https://wordpress.org/support/topic/cant-edit-my-old-backuped-posts-404-error/#post-1270265)
 * I recently had the same issue when I tried changing the prefix of my tables manually.
   Luckily, I kept the original tables in tact while I tried to make this change.
   Everything was working fine for me with the exception of being able to edit both
   old and new posts/pages.
 * I tried the security fix referenced above and it didn’t work for me. But, when
   I reverted back to the original prefix everything was working. My guess is that
   I missed something in the _options table that needed to be renamed from the old
   prefix to the new one.
 * I’m not sure if you guys are having the same problem, but I thought I’d let you
   know about what happened to me. If I find a definitive solution (i.e. which option
   I missed or which database value needed to be changed), I’ll let you know.
 * Hope that helps some.

Viewing 2 replies - 1 through 2 (of 2 total)