Articles of database

Update image links in database

I recently changed the URL of a wordpress site and I can’t seem to find some of the image links I was able to update most of the links in the wp_posts tables update wp_posts set guid = REPLACE(guid, ‘’, ‘’); update wp_posts set post_content = REPLACE(post_content, ‘’, ‘’); Are there other tables, columns that […]

User Tracking for Custom Post Type “Lesson”. Database Queries and Performance

So I wrote this little code snippet to add a post id along with the current users id to the user meta table. I’ll use this to show the “lesson” posts that a user has viewed back to them. My only concern with this way of doing it this way is that it seems WordPress […]

Adding data to custom wordpress database table

I have a form on a page that populates the database table: <table border=”1″> <tr> <td align=”center”>Form Input Employees Data</td> </tr> <tr> <td> <table> <form method=”post” action=”input.php”> <tr> <td>Product Name</td> <td><input type=”text” name=”name” size=”20″> </td> </tr> <tr> <td>Brand</td> <td><input type=”text” name=”brand” size=”40″> </td> </tr> <tr> <td></td> <td align=”right”><input type=”submit” name=”submit” value=”Sent”></td> </tr> </table> </td> </tr> […]

What happens if I delete all the rows that represents a post revision from the posts table into WordPress database?

I have the following doubt related to the posts table of the WordPress database. I see that when I create a new post in this table are automatically created 2 new rows. 32 1 2014-08-16 15:07:22 2014-08-16 15:07:22 TEST REVISION TEST REVISION inherit open open 31-revision-v1 2014-08-16 15:07:22 2014-08-16 15:07:22 31 http://localhost/wordpressAsper/2014/08/16/31-revi… 0 revision 0 […]

Issue with data array format

I am trying to fetch a record of date from table booking_history with bellow code but the result array not displaying any record from start_date column. when i echo the query query displaying value accurately. $booking_date = $_POST[‘booking_date’]; $post_id = $_POST[‘post_id’]; echo $check_cust_query = “SELECT start_date FROM `”.$wpdb->prefix.”booking_history` WHERE start_date='”.$booking_date.”‘ AND post_id='”.$post_id.”‘”; $results_check_cust = $wpdb->get_results […]

Storing user submitted forms

I was wondering what’s the best way to create a form which can only be seen by registered users. The main idea I’d like to achieve here is for users to log in and gain access to a page where there’s an application form which can be submitted multiple times. Each form will be stored […]

How can I store data from custom fields to custom tables?

I know how to make custom fields for my custom post types. I also know there is the Advanced Custom Fieldsplugin. But I need to know how I can store my custom fields in my custom post type to my custom DB tables. I’ve been looking for tutorials, but I only find how to create […]

WordPress plugin DB upgrade

I am writing plugin. I have added 1 custom table in database. Suppose my plugin’s current version is 1.0 After few days i am upgrading plugin and now its version 1.2. Same for after some time and now version is 1.3 and ….. 1.4 Now for every release of plugin version I have made some […]

How do I debug an error that a plugin is causing?

I’m having an issue debugging why the plugin I’m creating keeps displaying the error You need to upgrade your database as soon as possible…. The work I’ve done so far has been on a remote dev site, and everything seems to work fine there – with no errors at all. I decided to test what […]

Why when I create a new post I found 2 record related to this post into the posts database table?

I am very new in WordPress development and I have a doubt about the WP database table named posts I have observe that when I create a new post (into the WP administration panel) are created 2 record into the posts table. For example, after that I have create a single post titled as DB […]