How to display results from a data table with an encrypted user id?

The plugin now works as I would like, with a little alteration. Instead of setting submitter_id to a random value, it is now set to the logged in user’s id. This will allow displaying other users’ answers. The + indicates new lines of code in the output_quiz.php file: function wpss_getQuiz($quiz_id){ global $wpdb; + global $current_user; … Read more

wpdb->insert not inserting first variable

I don’t see anything wrong with the code as far as $first_name is concerned. My guess is that your actual DB column name is spelled incorrectly in the schema, or is otherwise improperly set up (maybe it’s the wrong type, length, etc.). This doesn’t answer your question, but I do have a tip: when a … Read more

database not responding on localhost

Yes, while convenient, let’s rule out the variable of using the $_SERVER[‘HTTP_HOST’] trick and put in the absolute URLs. Here are some handy snippets I use when moving a site (you may want to use these to make sure everything is the same on your install): UPDATE wp_posts SET guid = replace(guid, ‘http://www.olddomain.com’,’http://www.newdomain.com’); UPDATE wp_posts … Read more

Creating and Using Tables in the WordPress Database

The requirements you’ve specified don’t indicate any need for a custom post table. Just register a custom post type using register_post_type(), and then manipulate its entries using the standard WordPress API. Example from the codex, registering a ‘book’ custom post type with a label of “Books”: function my_init() { $args = array( ‘public’ => true, … Read more

Database migration issues – Error #1046 No database selected

99.99% chance that you configure wordpress with wrong database details. make sure you are using correct database details in wp-config.php file /** The name of the database for WordPress */ define(‘DB_NAME’, ‘database_name_here’); /** MySQL database username */ define(‘DB_USER’, ‘username_here’); /** MySQL database password */ define(‘DB_PASSWORD’, ‘password_here’); /** MySQL hostname */ define(‘DB_HOST’, ‘localhost’); some possibilities are … Read more