WordPress stores user generated content, along with other configurable information, in a a database (typically MySQL).

learn more… | top users | synonyms

0
votes
0answers
11 views

How Do I Merge Categories With phpMyAdmin

I tried the following phpMyAdmin query to merge my category 112747 into my category 112748: UPDATE wp_term_relationships SET term_taxonomy_id = 112747 WHERE term_taxonomy_id = 112748; It did not ...
1
vote
1answer
9 views

Detecting errors generated by $wpdb->get_results()

How do I detect errors when using $wpdb->get_results()? For example: $result = $wpdb->get_results("SELECT * FROM this is not a valid query"); The preceding code doesn't generate any exceptions ...
1
vote
0answers
10 views

Delete duplicate rows from wordpress database where a column is duplicate in phpmyadmin

I have a wordpress table like so (phpmyadmin and MySQL) | id | meta_key | meta_value | +----+-----------+------------+ | 1 | import_id | abc | | 2 | import_id | abc | | 3 | ...
0
votes
0answers
14 views

Inserting posts to database

I want to import a bunch of posts directly into the database and I'm wondering how I can do this? I found this script ...
0
votes
0answers
8 views

wp_insert_post another database with custom field

wp_insert_post with the command you want to transfer the contents to another database, I use the following command <?php require('wp-config.php'); $conn = mysql_connect($dbHost, $dbUser, ...
-1
votes
0answers
22 views

Remove comments from database

I have a number of comments generated by a WooCommerce payment gateway module. For some reason the comments can not be deleted in the backend (no checkboxes). Would it be safe to delete them from the ...
0
votes
0answers
10 views

How to parse meta value from user specific post to google charts?

I'm currently working on a project where i need to visualize the progress of users (fitness). For that i have created a custom post type with custom fields. I want to parse the meta values associated ...
0
votes
1answer
32 views

$wpdb->get_var - What value is returned when zero records are found?

I have the following code: $queryPermission = $wpdb->get_var( $wpdb->prepare("SELECT Active FROM testers WHERE user_id = '$user_id' ")); ...
0
votes
1answer
50 views

single.php not pulling in any data from database

My single.php doesnt seem to be fulling any information through from the database for the current post. here is my single.php code: <?php get_header(); ?> <div class="main-container"> ...
1
vote
2answers
73 views

Should I global $wpdb outside of any of my plugin's functions scope?

I know that the general advice to global variables is to not use them at all. Still, when doing something with the Wordpress database, it is required to do global $wpdb; to access the methods ...
1
vote
1answer
60 views

Wordpress database error - Error in SQL syntax - I can't identify any error?

I am trying to write function that checks whether an email address is stored in my database or not. I've written the following PHP code:: function check_my_users( $email_address ) { global ...
0
votes
2answers
32 views

Duplicate domain database to local - How?

I've noticed that my process is rather slow and i'd like to speed it up. I want to be able to duplicate my database from my domain which is blueharlequin.com and work locally thus speeding up the ...
0
votes
1answer
26 views

Understanding WordPress Search

I am trying to create a custom search similar to the one on totaljobs.com but through a WordPress site. Essentially I would be able to search for both search terms and location simultaneously. The ...
1
vote
1answer
28 views

How to store custom user data on the database?

I'm developing a WP multi-site network which have a goal of 10,000 sub blogs. The site needs to store custom data related to the user. There are additional 20 fields of data for each user. What is the ...
0
votes
1answer
24 views

What is the purpose of storing `siteurl` in database?

Why does WordPress store 'siteurl' and 'home' in the database? It's driving me crazy because I develop locally, deploy to a staging site, AND to a production site, so that's two-three times I have ...
1
vote
1answer
14 views

How to display posts by vote count and if no value continue with latest posts with no votes?

Maybe someone can help me with this. I want to display posts by votes. Users can only vote up. So what I want is - the most voted posts by vote count on top and then latest posts with no votes. The ...
3
votes
0answers
58 views

Uploading/Deploying a Multi Site Install

So I was looking to create a multi site for a clients since the goal is to have the same branded theme on several sub domains to deal with different countries (e.g. mysite.com, usa.mysite.com, ...
0
votes
0answers
44 views

How to select from a WP table every 10s in a class (OOP)?

I'm trying to select records every ten 10 seconds from columns message and messagetwo from my WordPress table wp_userlogin, but the code is not being executed. I'm calling wp_schedule_event when my ...
1
vote
0answers
19 views

Removing Mutlisite lines stop DB connection

I'm trying to revert my mutlisite to a single site and following a guide it recommends removing the following /*define( 'MULTISITE', true );*/ define( 'MULTISITE', false ); define( ...
-3
votes
0answers
18 views

How to store form submissions and edit their statuses in admin area?

The main idea is to create form (product purchase) and store submissions in DB. In admin area I need to assign statuses for each submission and assign completion to user role 'manager'. Create user ...
0
votes
0answers
21 views

A plugin is giving me “You do not have sufficient permissions to access this page.” error

I noticed this morning that I was logged off from my site. Whenever I tried to access /wp-admin it gave me a "You do not have sufficient permissions to access this page." error. After an hour of ...
1
vote
1answer
33 views

Access Wordpress database outside of Wordpress

MAIN QUESTION: I am writing a wp plugin. Within it, I have a page located here: http://example.com/wordpress/wp-content/plugins/myplugin/page.php How do I access WP database from this page? Is ...
1
vote
1answer
34 views

Is $wpdb->prepare escaping to much? How to use it properly?

Im pretty much confused by $wpdb->prepare. I want to use it to sanitize user input but it turned out that it destroys the query. I cannot imagine that this is how it's intended to work but I can't ...
1
vote
1answer
199 views

Hello dolly type plugin that allows people to add their own

I am making a plugin that shows a random joke on a custom 404 page via shortcode and it is basically near enough the same as the default hello dolly plugin, where the jokes are hardcoded into the ...
0
votes
0answers
17 views

Save voting stats with Posts 2 Posts

I am working on a website where I make connections from posts to posts with the Wordpress Posts 2 Posts plugin. Now I want my website users can vote whether they think the 2 connected posts are a good ...
-1
votes
1answer
27 views

Remote database -> massive response time increase?

I have nginx web server running newest WordPress and DB server running MySQL 5.6 There is around 90-100ms latency(round-trip delay) between those 2 servers. The problem is that It takes about 5000 ...
0
votes
0answers
32 views

Mysterious template change after database import/export

When I switch databases from my local environment to the host, some of the pages inexplicably change templates. E.g. there is a custom template "Home" and when I switch the db's it ends up with the ...
1
vote
1answer
44 views

How to create custom tables in WordPress using my own plugin?

I am new in WordPress plugin development. This is my core PHP and HTML code create-table.html <form method="post" action="function.php"> <input type="text" name="table_name"> ...
1
vote
2answers
39 views

How should I store a log for my plugin

I have a plugin that sends data to a server as part of a transition_post_status action. The server sends a response each time. I want to keep a log of these responses (permanently) that I can display ...
0
votes
2answers
73 views

Different database query in function.php using mysqli

I am trying to connect to a database in the function.php using mysqli. The code seems to run fine when it is not on a separate php file not on wordpress. But when I run it on wordpress I get "Connect ...
0
votes
0answers
49 views

Problem with Featured Image and database

I have an issue with with WordPress install which I just haven't been able to resolve... I have tried disabling all plugins and reverting back to default theme, but the problem remains. The issue is ...
0
votes
0answers
36 views

wp_usermeta key problem

I am trying to add a meta key to wp_usermeta but it does not work at all. The key would get value from a checkbox. I used the code from Wordpress codex tutorial and it's not adding anything. I will ...
0
votes
0answers
17 views

Are custom tables a good solution for adding lots of data to the site?

On a fairly high trafficked website (10-20 million page views per month), we're looking to add a large amount of data to build data-driven pages. Think of adding 1000s of restaurants to create ...
0
votes
2answers
49 views

Can WP give a value a post ID?

So I have queried out some data from another DB and obviously they're not a post which means I can't use the standard permalink to link them to an existing page with it's post type. So I thought that ...
0
votes
1answer
25 views

Custom Post Type not showing anything added by code anymore?

So I have a piece of code written and it worked before, hasn't been edited hasn't been changed, no updates on the WP DB no updates on any plugin on WP and it's suddenly not working correctly. This ...
9
votes
1answer
129 views

How can I trust switch_to_blog()?

When I call switch_to_blog() with a blog id, I don’t know if that blog actually exists. The functions returns always TRUE. Here is my problem: switch_to_blog( PHP_INT_MAX ); $post = get_post( 1 ); ...
0
votes
0answers
11 views

Bookmarking a post in exchange for an email?

I was asked to implement a feature that this website https://medium.com/ has, which is the ability to bookmark a specific post by making the user register an account with the website. This is the ...
0
votes
0answers
18 views

Email notifications: Where in database to save user options?

I'm working on an email notifications plugin which sends emails when events happen on my site. So for example, if someone comments on a post, the post author will receive a custom email notification. ...
0
votes
0answers
28 views

What method should I use to store my plugin data (multi level menus with options on each item)

So the background on my plugin - it generates taxonomy/term filters to give you a filtering system similar to what you'd see on NewEgg where you filter your results by category/manufacturer/other ...
0
votes
2answers
34 views

Is it possible to have more than 1 sql databases in my wordpress blog?

I m watching video on installing wordpress manually. on first launch wordpress prompts you to input your sql database name, sql password etc. then i can start working from dashboard. is it ...
0
votes
2answers
53 views

Wordpress and a secondary database?

I have to achieve something on which I don't know how to approach it. Base of the issue: There's a bunch of data in another DB that I have to import into WP which so far wasn't possible due to them ...
8
votes
1answer
117 views

How can I make updates to a site, on a development copy, but then move updates back without overriding live site's evolving database?

I've tried to be as descriptive in the title as possible, and I know this question has been asked in before in various forms but I could not find good answer to it and it's are to imagine that no one ...
0
votes
0answers
16 views

Author ID mismatch from database

The author->ID for one particular author is returning a different value than what exists in the database. The database has the author's id as 2, but when I query author->ID, it returns the value 11. ...
1
vote
1answer
50 views

wpdb update add current timestamp not working

So using the $wpdb->update to add some data to a custom table, trying to add the current timestamp but it's not saving the right stuff(0000-00-00 00:00:00 this is saved). overview code ...
0
votes
1answer
49 views

How to access the WordPress DB from a plugin file

I'm building a basic video management plugin, with an embed feature that will have URLs like: mysite.com/wp-content/plugins/embed-video.php?video=[POST ID] I plan on using the [POST ID] url parameter ...
1
vote
0answers
36 views

Wordpress plugin creating database in localhost but not on real host

So I am busy creating a plugin that creates a custom table to read in some data. The plugin works 100% on localhost but does not create the table in the db on the real host. I have debug enables and ...
0
votes
1answer
21 views

Connecting to a 2nd DB gives me no results when querying

I'm trying to access a different DB on the same localhost as my wp db is and I did this like so: functions.php: add_action('init','my_new_db'); function my_new_db(){ $newdb = new wpdb( 'test', ...
0
votes
0answers
36 views

wpdb->insert multiple record at once

So after I have created the table 'settings-table' i want to add a couple of records to it. This is how I want to do it, not the best way, so I need a better way to do this because I will add more ...
0
votes
0answers
29 views

Searchable database of members using multiple criteria / filters

I'm very new to wp let's say that first! What I need is to create a site which will list a database of members of an organisation. Users will also be able to sign-up and add themselves to the ...
0
votes
1answer
18 views

Changing starting number of User ID

I've got a client who would like their online user registration to match their current database. Thus they'd like their wordpress sign ups to start with 00100, I can't seem to find a plugin that ...