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

learn more… | top users | synonyms

3
votes
2answers
3k views

Insert query inserts 2 entries, should insert 1

I've written a small posts by views plugin, well at least started one. My tables are set up but when they are updated the code adds 2 entries into my table when a post is loaded and views are ...
1
vote
1answer
22 views

Trying to establish connection to External Database

I'm trying to get a connection to a separate external database from the database the wordpress site depends on. I have a PHP file inside the same location of my theme, it is basically a blank PHP it ...
0
votes
0answers
18 views

Assign $wpdb to a class property to access WordPress Database [on hold]

In my PHP Class instead of calling global $wpdb all over the place to access the database I want to assign it to a class $_db property. If I vardump() my $this->_db it shows all the stuff that ...
2
votes
2answers
1k views

Ways of managing staging and production wordpress sites?

Ok I've see a lot similar questions.. but they all either outdated or do not fall in in my problem. So the problem is: We have a website and its clone stage website. On that website apart form me ...
0
votes
3answers
796 views

Fetch a single row from a custom table for to a given ID

When I want to get a single row from a custom table of my WordPress database by providing a username through function call, it does not work. When I mention the username in where clause of the query, ...
0
votes
1answer
28 views

Get posts and include taxonomy term

How can I return taxonomy terms within post data, from the same query. Currently I'm calling get_posts / wp_query and then looping over and calling wp_get_post_terms. Needless to say it thrashes the ...
0
votes
0answers
12 views

INNODB Supports transactions, row-level locking, and foreign keys

When I try to create a table for a plugin (that was dropped in the past) I get the error: #1005 - Can't create table 'database_db.wordpress_popularpostssummary' (errno: -1) (Details…) And the ...
0
votes
1answer
25 views

$wpdb->delete column values IN ARRAY()?

I am wondering if this is possible? $wpdb->delete( 'table_name', array('id' => array(1, 2, 3)), array('%d') ); So, in this situation, it should remove 3 rows at once, and call the ...
-4
votes
1answer
10 views

Modifying 'post_content' on 'wp_posts' but post not getting updated [closed]

I had to make some changes in some of my wordpress posts and I thought about making them directly on the database. I opened phpMyAdmind and I went to 'wp_posts' and found one of the posts, clicked ...
-3
votes
0answers
24 views

Wordpress content not updating

Any Ideas on why changes on a website does not reflect until user logs out and log back in. However, the updated content can be seen in the database even when it is not showing on the website.
0
votes
5answers
32k views

Custom form that store input in database

I have never used WordPress before, but have done a lot of programming. But what is the normal way of making customs forms? I need to create a form where a user fill some input fields and on submit ...
0
votes
2answers
29 views

Change options table prefix only

I am not able to find, How can I change the only options table prefix. I do not want to change other tables prefix only need to change options prefix. Please guide me. Thanks
2
votes
4answers
2k views

How to empty wordpress custom post Database table

I have around 2000 custom posts. And 7 regular wp pages. I want to delete all those custom post without effecting the pages. I thought the easiest way would be to empty the custom post table but I ...
0
votes
0answers
14 views

WordPress Integration with Drupal

I could use some assistance. Can I build a site using WordPress as a CMS for one function, and use Drupal for another site (more of a CRM suite app) elsewhere, and grant permissions to records within ...
0
votes
1answer
32 views

Get wp_current_user_id using PHP and MySQL

awesome people of the Stack Community! Like the newbie coder I am, it took many hours but at last I got: a HTML form inside wordpress -> to submit value to MySQL database -> and then store the ...
3
votes
1answer
38 views

Is sanitize_text_field() is enough to save to DB?

So here is the situation. We allow users to enter input data, i.e. user_first_name and user_additional_comments. Then we use sanitize_text_field() , which is named as save. But after this filter: ...
0
votes
1answer
29 views

what are pmxi tables?

I'm on multisite mode. I can see that for each site of the network there are 4 'pmxi' tables. What are they for? They're something like this siteprefix_pmxi_files siteprefix_pmxi_imports ...
2
votes
1answer
835 views

Issue with wp_insert_post and post_content field error Could not update post in the database

I'm having issues creating an import / caching script to be used within a WordPress site. This feed comes from a single text file that is then parsed and returned as an array. When running through ...
0
votes
0answers
243 views

Link wordpress with a SQl + MongoDB + .NET

This may sound a bit crazy, I have a website using different DB, One SQl; one MongoDB, and a .net API I would really really love to be able to move this to a wordpress installation ( or Magento). ...
2
votes
1answer
34 views

Usage of Direct Database Call Without Caching Error

I have a custom function that creates a dynamic copyright year range based on the year of the first and last posts in the database: function jldc_copyright_dates() { global $wpdb; ...
0
votes
1answer
2k views

Retrieve and display data from custom db table in admin area?

So, i'm having a bit of an issue with a plugin i'm developing, I wonder if anyone can shed any light on the situation, as many, MANY searches have come back with zero help. :-/ Basically, my plugin ...
-3
votes
0answers
21 views

Error establishing a database connection on amazon ec2

I'm getting an error establishing a database connection on Amazon EC2. The database is there and I have the right credentials. Here is my wp-config.php: <?php /** Enable W3 Total Cache */ ...
1
vote
1answer
425 views

Create custom column in post table in wordpress

I want to add two custom field to table wp_posts, and that I need for my plugin. now to enable these fields I have changed core file of wordpress wordpress/wp-admin/post.php $data = compact( array( ...
0
votes
3answers
42 views

moving wordpres from one VPS to another - Error establishing a database connection

I had a wordpress site on VPS server and decided to move to faster one - with the same host provider. I had VPS on CentOS with Plesk and moved my domain to another one with the same OS. I have ...
3
votes
1answer
600 views

$wpdb->prepare() warning in WordPress 3.5

I am receiving this warning when I try to run a database query: Warning: Missing argument 2 for wpdb::prepare() The offending query is: $result = $wpdb->get_var( $wpdb->prepare( ...
0
votes
0answers
21 views

Search result by taxonomy name

Currently my search filters by title and I'm trying to filtered by taxonomy tags. How do you I do that. Here is my code: $query = " SELECT * FROM $wpdb->posts WHERE $wpdb->posts.post_status = ...
0
votes
1answer
41 views

Sorting custom post type columns with external data and without meta values

I created a custom post type 'Book', for which data is stored in an external database (like ISBN, author etc). The WordPress database contains the ISBN per custom post, which connects the correct data ...
0
votes
0answers
21 views

Using SET statements in wpdb query

I'm running the following queries directly on the database: SET @curr_time = IF(TIME(NOW()) < '06:00:00', DATE_SUB(NOW(), INTERVAL 1 DAY ), NOW()); SELECT Start_Time as 'start_time', Title_Name as ...
2
votes
1answer
616 views

how to show database content in wordpress post

I'm a beginner for WordPress. I have a database app written in PHP and MySQL and I need to convert it to WordPress and also I what to post the database rows info by shortcode were id="x" like: ...
1
vote
1answer
30 views

Wordpress Database lost auto increment

After rolling back a Wordpress database to a backup version it seems that all the tables lost their auto_increment on the primary key columns. I read on another post this could be to do with InnoDB ...
1
vote
0answers
28 views

The word 'exit' in a content box causes WordPress to serve a 'Not Found' page [closed]

I've been developing with WordPress for years, and this is a new one. When the word 'exit' is included in the content of a post, even if inside another word like 'complexity', the post will not save. ...
0
votes
1answer
32 views

wpdb query on custom table not working [closed]

I want to show one custom table from my database on which WordPress is installed. So I googled this code: <?php $results = $wpdb->get_results( $wpdb->prepare("SELECT * FROM ...
0
votes
1answer
473 views

Merge two databases: OLD SITE -> NEW SITE

I am working to a restyle of a website. I made DB dump from remote server and made local installation, then started to work on my local machine. While i've been working other post have been added to ...
0
votes
2answers
2k views

Storing textbox values in Database

I am new to WordPress but I am good with PHP programmings, if I wanted to get value from the textbox and store it in the database in WordPress can I do? for ex form1.html <form name="form" ...
-1
votes
1answer
24 views

1000+ records per user: Multiple user tables or one large table

I want to allow users to have 1000+ records in my wordpress system. I was wondering is it best to have just one table for all users and their records or one table per user? Keep in mind that I ...
1
vote
1answer
19 views

Can I transfer a mysql database to another site?

I've been playing around with WP for about 2 years so I know my way around, but I'm kinda new to working with databases. I've been making sites not relying on a database too much. However, I have a ...
0
votes
1answer
24 views

Scheduling posts in database

I have more than 100 posts to schedule. I have set the date and the status (future) with a SQL query. But when the time comes the post is not published and in desktop I can read message 'Schedule ...
0
votes
1answer
632 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 ...
0
votes
1answer
575 views

Save custom meta box data to database

I have a custom post type Events. Under Events, I have a custom meta box which selects the time and data of the event: <?php $meta_boxes[] = array( 'id' => 'event_date_option', 'title' ...
0
votes
0answers
31 views

Storing Unique Data on the Database

I have created a custom table on my database using the code below: function dbcreator_activate() { global $wpdb; $table_name = $wpdb->prefix . "ftbstatistics"; if( ...
0
votes
0answers
12 views

Exporting a multisite DB for a single site production site

So I have a wordpress multisite that houses all of my client test sites(14). This means that its all one database obviously. This client is now ready to go live on a single wordpress instance so I'm ...
0
votes
2answers
57 views

Why my wp_posts data is so huge?

My WordPress has only 23 posts but the wp_posts data is over 70MiB. Is it the average size? The Posts I have were created with WPBakery Visual Composer and has 10 revisions. However, I deleted all the ...
0
votes
1answer
23 views

How to transfer one domain to another domain without losing theme options (customizer)?

I have developed the one wordpress site with custom theme, Here I used the custom customizer options. Then site completed on my local machine I mean localhost (http://127.0.0.1/wordpress). Now the ...
0
votes
1answer
22 views

Finding the login page from database?

long story short I was given the login information for an older gentleman who unfortunately passed away who managed a young lady's Wordpress website. Was asked to manage and update the site for the ...
0
votes
0answers
12 views

Options of accessing wordpress data from mobile app

There is an existing wordpress website and I would like to make native app(probably will do crossplatform native with React Native as I have experience with it) for it. So my question is: is there an ...
0
votes
0answers
20 views

Custom database query with accents returning no results

I have an issue where using accents in my custom database query (wpdb) returns no results. $wpdb->get_results( "SELECT * FROM table WHERE city = 'Montréal'" ); Returns nothing, while ...
0
votes
3answers
51 views

Create Tables in WordPress

I am very new to WordPress, and today is my 1st day on WordPress. I have a requirement which is very normal for any developer on their platforms, but for me it's challenging In my WordPress site I ...
0
votes
2answers
4k views

Inserting data into custom tables

I am trying to create custom input tables to send data into custom tables on the wp database. I cannot get my script to do anything. The user will enter a type of liquor, like vodka or whiskey, ...
1
vote
1answer
36 views

Plugin Options Not Saving to Database in WP 4.5

WordPress 4.5 broke my plugin and there are no obvious clues why in the change log The plugin controls the visibility of menu items. Users select one or more countries and whether to show or hide the ...
0
votes
1answer
16 views

Missing latest posts and options after DB migration via phpMyAdmin

The latest posts and options are not appearing after importing the database. I'm missing all the latest posts and the latest Advanced Custom Fields. The export is from the remote server and import to ...