Articles of database

Cloning and syncing a WordPress website

I plan to bulid up a nice developer environment and for this I need to clone the actual running website to a 100% into a dev directory. I’ve now uploaded the same version of wordpress as on my running site and wondering if I could enter the same database and the same prefix as for […]

Recovering the table wp_usermeta from users

We had an accident and the table wp_usermeta got truncated. I have the table wp_usermeta from the staging environment I pushed it in but when I try to login with the admin user (id 1 on both of them) I’m getting this message: Sorry, you are not allowed to access this page. I’m being able […]

wordpress site – using custom database and PHP

I have finally finished coding a project with an HTML form for file upload, and a large PHP file that submits a 200 field CSV into my database. It first uploads to a staging table and then splits the data into smaller tables. This all works perfectly but I’m having problems with the next step: […]

Hook directly into query execution

I am building a simple caching class and I want to use this class to cache queries. My initial thinking was to create a Query class and use this to handle all queries, meaning the Query class would use my Cache class to check if there is a saved query, otherwise it would run WP_query […]

Clean up customize_changeset in DB

Is there something similar to define( ‘WP_POST_REVISIONS’, 0 ); for customize_changeset type so they’re not collected in DB.

Filter results from a serialized string to use on statistics

I need to get the values from a serialized string, to use it on some statistics. I already got that info in other pages to show some content, but I have no idea why I’m having this problem now. The DB has a table called wj_db7_forms (I’m using a WordPress plugin to log the inputs […]

Add search bar to Custom Database Table in WordPress Dashboard

I have built a custom table within the WordPress database. From there I have put together a plugin which creates a dashboard page allowing you to view the various rows within the database by extending the WP_List_Table function. What I need to do now is add a search bar functionality. I have been able to […]

How to add Edit | Delete button on rows?

I want to render columns with actions. When hover on row, Edit | Delete links show. Problem at function column_name($item). I don’t know why don’t run to this function. I tried to add wp_die() into this function but don’t have anything change. I written class extend WP_List_Table: class Custom_Table_Example_List_Table extends WP_List_Table { function __construct() { […]

How can I detect right db type?

I write plugin and use in my code this function: mysqli_multi_query($wpdb->dbh, $sql_trigger);. It’s not hard to guess that on some hosting systems this function works correctly, but on some it produces the following error: Warning: mysqli_multi_query() expects parameter 1 to be mysqli, resource given in /home/blah/ on line xxx Question: how do I determine which […]

Connection refused on locahost after importing database?

I’m using WordPress Instant for my development environment. It’s a portable dev environment that allows me to run a local wp install off a usb, so it’s portable and I can take it from one computer to the next in a nice self contained fashion. Previously I was using MAMP. The initial wp install went […]