How to Import Multiple Values in custom field

The granularity of data in your example suggests that custom field (more so one with multiple values) would be wrong choice in first place. Think about it like this: only one dog might weight precisely 35.5kg — that is type of data appropriate for custom field multiple dogs (or dog breeds) might be of medium … Read more

`#1215 – Cannot add foreign key constraint

In order to make the wp_posts(ID) a REFERENCE for the FOREIGN KEY, you should also set the wp_pageviews.ID‘s attributes as UNSIGNED and keep the same data type for the wp_pageviews.ID as (bigint) . Let me know if this helps you.

Datatabase error: Commands out of sync

This seems to be a problem with “orphaned SELECT statements”. It is described here in more detail. One solution would be to create a temporary table and modify my_acquireuserpasswd to save data to temp_table BEGIN DECLARE passwdtemp VARCHAR(64); DECLARE temp VARCHAR(4000); START TRANSACTION; SELECT id, passwd INTO uid1, passwdtemp FROM users WHERE name = name1; … Read more

MySQL database gives blank page (white screen of death)

From the looks of it, you should be changing the pre-existing urls from /www.mypage.no to /localhost The /var/www is part of the file path normally (though i suppose you could potentially set the server up that way…), so more than likely wordpress thinks it is at /var/www relative to the web root instead of /. … Read more

Add value to array in database

Your table does not have a timeofvisit column. The second value of $wpdb->insert expects column value pairs, see here. Try $wpdb->insert( $table_name, array( ‘timestamparray’ => $timeofvisit, ‘userid’ => ‘2’ ) );

#1115 – Unknown character set: ‘utf8mb4’

WordPress does not support MySQL 4 : To run WordPress your host just needs a couple of things: MySQL version 5.0 or greater (recommended: MySQL 5.5 or greater) https://wordpress.org/about/requirements/ While the utf8mb4 encoding is recent change and you might work around it, overall you still need compatible MySQL version.

Saving custom term value to the database in new table

short exmaple how i do it… (tables naming not really correct.) in this example i am trying to save _description $_POST variable. add_action ( ‘edited_term’, ‘custom_edited_term’, 10, 3); function custom_edited_term($term_id, $tt_id, $taxonomy){ if ( defined(‘DOING_AJAX’) || defined(‘DOING_CRON’) ) return; $_POST = stripslashes_deep($_POST); if (isset($_POST[‘_description’]) && trim($_POST[‘_description’]) != ”){ update_term_meta($term_id, ‘_description’, trim($_POST[‘_description’])); } else { delete_term_meta($term_id, … Read more