All Questions

Tagged with
Filter by
Sorted by
Tagged with
0
votes
0answers
53 views

Could not insert post into the database - Media

im currently having a database error in my Wordpress Media section. Everytime i upload a file i get a "Could not insert post into the database" error. The site was migrated from one hosting to ...
0
votes
1answer
23 views

Why does changing Database Table Prefixes result in loss of content?

As to add an additional layer of security, to an eCommerce website I am working on, I have changed the default Database prefix from wp_ to wp_additional_prefix. To do this, I opened the wp-config....
0
votes
0answers
30 views

Create a custom table with column as an index

I want to create a table in my wordpress database with a column that is an index. But I can't seem to make it work with this code: $table_name_t2mtokens = $wpdb->prefix . "t2mtokens"; $...
0
votes
0answers
26 views

stop execution and Display Errors when inserting data to custom table

I created a stats table. on a daily basis I retrieve data from Post meta, aggregate it and insert it into the stats table (code bellow). function updatePostDay($postID, $month) { global $...
0
votes
2answers
29 views

Code is providing a row of data but not formatting it as table

I am using the following code: function seconddb() { global $seconddb; $seconddb = new wpdb('username','password','g3boat5_G3_Genba','localhost'); } add_action('init','seconddb'); // add the ...
0
votes
0answers
41 views

What charset/collate should we set for our custom database table?

I've seen this nice topic, but my question might be slightly different. Is it good practice to set your custom DB table (i.e. for plugin, which saves utf8 text) charset explicitly , like: CREATE ...
0
votes
0answers
23 views

How to map data on CSV to web pages?

Like Contact information, descriptions, budget, prices, other numbers, on a CSV or spreadsheet, how to link it to WordPress web page? I'm using cpanel, WordPress, Tablepress plugin, elementor page ...
0
votes
1answer
548 views

How to access custom Wordpress database tables

I have this sample code that I found online that's supposed to count the number of rows in a table. Of course... It works, but when I created my own table using phpMyAdmin... It no longer works. What ...
0
votes
1answer
49 views

Separate by Category Post Type

Assuming i have this kind of data $query = new WP_Query(array('post_type' => 'Hotels','posts_per_page'=>-1)); but i want it to separate them by specific field (eg location) and to trigger this ...
1
vote
1answer
85 views

Change Wordpress prefix for only one table?

I have a little question about Wordpress database. I want to know: Can I change the wordpress pefix for only one table? Thet means I use on one Wordpress Page two Prefixes. If it works how I want to ...
1
vote
0answers
50 views

Retrieve data from the database to table such as comments in the admin control panel

Hi guys: I hope that you will be in good health I use the form below to enter data into the database in WordPress. <form action="<?php echo admin_url('admin-post.php'); ?>" method="post">...
0
votes
3answers
59 views

How to create a page that contains a list of post titles from specific categories?

The idea here is the following (I've now uploaded a picture to make it clearer what I need): Create a new page that contains a nicely formatted CSS table. Each row would refer to a specific post ...
1
vote
1answer
39 views

Moving to another host; which tables to move in a database

I'm moving my website to a new host and would like to move only my posts and images to the new site. I don't want to use WP export because I've had bad experiences going that route. I don't want to ...
0
votes
2answers
131 views

Can I customised default WP table

I have a XML file that consist of product information. Format of XML file : <product> <name>Product-1</name> <description>this is product 1 description</...
2
votes
0answers
1k views

Database with mixed collation (utf8mb4 & utf8_general_ci)

Each time I was uploading my WP install from offline to online, I was noticing strange characters in text and digging a bit I have discovered that wp-config.php on the online server was set to define('...
2
votes
1answer
52 views

stdObject stored in database. How does one convert it to usable format?

So I logged on phpmyadmin, went to check out how data is stored in a table and saw it''s 'data' columns contents (pasted below): a:8:{i:2;O:8:"stdClass":2:{s:5:"label";s:6:"Vardas";s:5:"value";s:1:"A"...
0
votes
2answers
289 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
6
votes
1answer
1k views

Wordpress Unit Testing - Cannot Create Tables

I'm using PHPUnit to Unit Test my WP plugin on top of the WP testing suite. Everything works fine except that when I try to create a table via the setUp method, the table doesn't get created. Here's ...
1
vote
0answers
101 views

Show all data in database table and make it into an interactive table

I have to make a table where my data from my database can be stored and rearranged with every row. The name of every row should be a link to the function mymanual_edit(). Look at the image for ...
1
vote
0answers
157 views

Least expensive way to get table prefix in multisite installation

I am writing an api that will have to handle extremely high volumes of calls so, in short, I can not afford to load the WordPress core every call. I have no problem building the API to use the ...
0
votes
1answer
81 views

Need help for creating custom table on wordpress

I'm trying to learn how to create and use custom tables on wpdb for a plugin that I'm going to build. So far I've seen a bunch of tutorials and know how to create a table but I'm facing problems ...
0
votes
1answer
591 views

Show a table from data submitted by a form from a user

I would like to show a table on my wordpress site, which is filled by registered users. How can I realize this? So my thoughts are: Registered users should be able to submit 2 variables through a ...
1
vote
0answers
511 views

Create a table with wordpress plugin boilerplate

I am a new wordpress developer and i would like to create my first wordpress plugin based to wp plugin boilerplate template plugin. My plugin will have to do with my clients data so for this reason i ...
0
votes
1answer
632 views

Wordpress mysql table double prefixes

Currently working on updating a wordpress website for a client of mine. The wordpress mysql database has double prefixes in it though. The standard wp_ prefix and her own custom prefix for the tables....
0
votes
3answers
1k views

Can I create a table on my DB without creating a plugin?

I have a built in form I created on my WP website . I want to store the inputs to a table on my DB. All tutorials that explane how to create a talke include the fact that I have to create a plugin ...
15
votes
2answers
15k views

Is it mandatory to use $wpdb->prefix in custom tables

Sorry if this question is trivial. I'm just beginning to develop plugins in WordPress. In all the tutorials I found this: while creating the custom tables, $wpdb->prefix is used. Example: $...
0
votes
1answer
275 views

dbDelta not installing database

I'm not sure why this isn't running. When I output dbDelta it says that it created the table, but it doesn't. I think my SQL is valid. Taking everything out between id and UNIQUE KEY results in the ...
0
votes
1answer
2k views

Creating a search form and displaying results

Im trying to create a plugin for a site where the user can see a table of orders from customers in the Wordpress dashboard, It's a custom db but I'm using the wp-list-table, I've wrecked my brain for ...
1
vote
2answers
2k views

Creating table with plugin is not working

After reading many question and answers and many had asked the same question I have been following the same instruction as the people instructed but my bad it's not working I have used dbDelta($sql) ...
0
votes
1answer
487 views

Insert double entry in DB

I created plugin and my plugin create new Table in DB. My problem is when user type something in field firstname, lastname... and click on button Submit, that go to my table and that is ok.. but then ...
0
votes
2answers
394 views

Multiple instance of data in plugin custom database table on plugin activation

I'm creating a plugin that adds some data to a custom table created by my plugin on plugin activations. I also created a settings page with a form that users can insert their own data to the database....
0
votes
1answer
32 views

Should I use an additional column in the DB?

I'm building a site for a client. They need a functionality where WordPress can tell if a logged in user has viewed a post in order that they might serve a notice or hide the original content. I ...
2
votes
1answer
31k views

How To Make Connection To WordPress Data Base In A Plugin?

I am learning Plugins and I am trying to connect WordPress database wp-config.php in my Plugin PHP code. Currently for checking my code, I used the below connection and it is working fine. Now I ...
2
votes
2answers
7k views

Save custom post type in different table

I need to store custom post type post data into a custom table, not in wp_posts and wp_postmeta. Is it possible? anyone help please. Actually, I have created two custom post type named "truck" and "...
0
votes
1answer
397 views

Display single post inside accordion based on form submission results

*Note - for full background see previous question here: http://bit.ly/1gaF673 Ok, so after fixing the problem above and a couple of issues that followed. My form submission returns the results I want....
0
votes
2answers
155 views

Database custom table issues - incorrect result displayed

First things first: I've spent most of today going over these forums; the stackoverflow forums; the php.net manual; and a bunch of random sites I found through Google Search - so, if I've missed the ...
2
votes
2answers
4k 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 ...
5
votes
2answers
6k views

What for is the table “wp_commentmeta” exactly?

I have been reading about the Database Description of Wordpress. I haven't understood the meaning to the use of the table wp_commentmeta. The documentation says: Each comment features information ...
3
votes
2answers
1k 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
1answer
4k views

Query multiple tables at once?

I want to query all of the posts in my WordPress multi-site set-up looking for a certain string. This is only being done in Sequel Pro (on the command line) for my own inquisitive purposes but there ...
0
votes
1answer
85 views

Create hundreds of users with just ID in phpMyAdmin

I'm trying to do the same as this post. But I have a problem with the insert records into your wp_users table containing all the ID's of the members you want to import Right now, I have 3 ...
5
votes
1answer
66k views

Insert data in database using form

I am writing a simple plugin that create a table with name "newsletter" in database and provide a shortcode to put a registration form in pages. the form contain "name" and "email". i have problem ...
5
votes
1answer
1k views

Has parent field in the table wp_term_taxonomy has term_id or term_taxonomy_id

I have created a category "Book" with a sub category "comics", to check how wordpress is maintaining the hierarchy structure. When i check the table "wp_term_taxonomy", I found that such term with a ...
2
votes
2answers
2k views

The plugin generated x characters of unexpected output, $wpdb not defined

I've written a simple Wordpress plugin to create a new database table. The new table ought to be created when the plugin is activated. When I try to activate the plugin, I get the following error: ...
2
votes
1answer
6k views

How to update BuddyPress xprofile fields programmatically? [closed]

I update user info using wp_update_user function. I also need to update the table wp_bp_xprofile_data. Is there any function, where I can update data on wp_bp_xprofile_data table?
3
votes
1answer
1k views

BuddyPress: What's the use of wp_bp_xprofile_data table and how does it get updated? [closed]

I have a questions related to BuddyPress: What's the use of wp_bp_xprofile_data table? How does the data in the table get updated? And when any user updates his information - does the data in this ...
0
votes
1answer
133 views

Will adding & modifying default Wordpress table index break future Wordpress update

I've some specific use case for certain default wordrpess tables, which I need to add a few indexes to certain columns to improve performance. I'm wondering will adding these indexes break future ...
20
votes
5answers
20k views

Where are wordpress custom types stored?

Where are custom types stored? Because when a custom type is created, in wp_posts, the post type is set to the <new_custom_post_type>. But where are the details of the new custom post type ...
0
votes
1answer
117 views

What is wrong here? Issue with post_id and meta_value

I'm trying to create a loop to read all the meta_value records from a given post_id. The idea is to gather all the meta_value's data from wp_postmeta table related to post_id number and print them as ...
0
votes
3answers
2k views

Custom Database Table and foreach

I have just created a custom database table and would now like to output every inserted row from it into a predefined format using a foreach statement. Some guidance in this matter would be great. ...