update_user_meta() does not work

You set the variable $user before you created this user.. It should be like this and you need to check if the user already exists $user = get_user_by(“email”, $email); // Its return you the user object if($user) { update_user_meta($user->ID, “quiz_scores”, $score); } else { $user_id = register_new_user($email, $_SESSION[“email”]); update_user_meta($user_id, “quiz_scores”, $score); }

Does WordPress ever need multiple databases?

could a WordPress installation get so large or gain so many users that it needs another database? If you mean sharding of a database to spread data across multiple servers for sheer quantity of data, then yes, but only for 3 or 4 websites in existence, aka WordPress.com. If you think you need this for … Read more

How do I reset a self-hosted WordPress URL?

The easiest way to do this is by using copy&replace in the SQL file. Export the database. Use your favorite text editor and do a copy&replace and import it into a new database. Then you go to wp-config.php and you change the WP_HOME and WP_SITEURL to the new host. Then you change the databasename. You … Read more

Use one WordPress database with multiple instances of one site

Turns out that instead of relying on the Database for a URL, you can set it in the config file, which solves the problem I was having, like so: define(‘WP_SITEURL’,’http://jack.example.com/test_blog/’); and then I set use a different config file for the other instance. soruce: http://codex.wordpress.org/Editing_wp-config.php#WordPress_address_.28URL.29

Creating table with plugin is not working

Your dot and quote notation is funky. Try this: if($wpdb->get_var(“SHOW TABLES LIKE ‘$table_name'” ) != $table_name){ $sql= “CREATE TABLE $table_name ( id INT(6) UNSIGNED AUTO_INCREMENT PRIMARY KEY, firstname VARCHAR(30) NOT NULL, lastname VARCHAR(30) NOT NULL, email VARCHAR(50), reg_date TIMESTAMP );”; require_once (ABSPATH. ‘wp-admin/includes/upgrade.php’ ); dbDelta($sql); }