30 questions
0
votes
0
answers
57
views
Why is my WordPress database table not available for a connection?
I've been building a site in WordPress currently based on my local hard drives using localhost. But I started receiving an "Error establishing a database connection" message.
The issue has ...
1
vote
2
answers
842
views
How to use $wpdb->prepare for dynamic value
I build SQL with a dynamic value from an array. How can I use placeholder or that dynamic condition?
I'm calling that function like this:
get_all_results("TABLE_NAME", ["column" =&...
0
votes
0
answers
441
views
Add woocommerce attribute and values in database
I want to add attribute to woocommerce via database directly. For that I create a new term in wp_terms and add new taxonomies in wp_term_taxonomies with term_id added above and slug with pa_ prefix.
...
0
votes
0
answers
102
views
Storing integer value in Wordpress db via javaScript and PHP
I'm running into a problem where I can't find a solution. I have a little game plugin which is written in JavaScript. Now I would like to store the highscore in my wordpress database. Therefore I ...
5
votes
1
answer
800
views
Is it safe to run MySQL transactions with $wpdb in WordPress?
As far as I understand the global $wpdb object utilizes just a single MySQL connection under the hood (by default).
Because the object is global every other plugin/theme/whatever seems to be using ...
0
votes
1
answer
358
views
How to manually offload wordpress media directory
A blog owner wants to free disk space in his shared hosting. In order to do that, he thinks to offload old media files to another external webserver (...instead of upgrading the hosting plan...). Note ...
0
votes
0
answers
156
views
restoring database from .frm & .ibd
I have a WordPress site hosted on a Linux server. I need desperate help restoring my database. I managed to salvage the phpmyadmin folder from the server and the following folders:
"var/lib/mysql/...
0
votes
2
answers
704
views
Delete column in WordPress database table
I want to delete a column from a table in WordPress.
I tried many ways but either they don't work or they delete the whole row.
But I just want to remove the status column.
I have a lot of tables and ...
0
votes
1
answer
2k
views
Fatal error: Unparenthesized `a ? b : c ? d : e` is not supported. Use either `(a ? b : c) ? d : e` or `a ? b : (c ? d : e)` when setting local WP
So I am in the middle of hosting a live wordpress site locally using XAMPP. The code is in a bitbucket repo and I have been given the database from the staging site to connect my local environment.
...
0
votes
2
answers
261
views
Insert fields into WordPress DB using wpdb->insert and gravity forms
I have been trying to insert some fields from a gravity forms submission into a custom WP database and can't seem to get the fields to populate.
// create a past speaking event
add_action( '...
1
vote
2
answers
527
views
Access with wordpress query to meta_key is in other meta_key (with cmb2 plugin)
First i tried to create a filter with ( pre_get_posts )
but finally i decided to create a page archive for my custom post (date);
I take the classic loop of archive page Wordpress and had $args
$args =...
0
votes
1
answer
524
views
update multiple values in one column using one sql query?
I am working with huge MySQL database and need to set same two values for one table field.
My table is post3 and set two values 'attachment', 'image/jpeg' for post_type column.
I have tried following ...
0
votes
1
answer
92
views
MySQL NOT LIKE '_%' not working on Wordpress woocommerce wp_woocommerce_order_itemmeta large database
I'm trying to search a Woocommerce mysql database for values that don't begin with _ however when I use
WHERE meta_key LIKE '_%'
this works perfectly, however when using
WHERE meta_key NOT LIKE '_%'
...
1
vote
1
answer
307
views
How to use wordpress $wpbd with custom table?
my friends.
I'm creating a custom php page on my wordpress website where I need to read and update a custom table. I'm using $wpdb class but I get no result when I use the table I create (the $result ...
0
votes
1
answer
90
views
combine users table on wordpress
I have to combine two tables on users search in wordpress: I need to add to normal search results the results from another table (with the original users table cloned structure).
I have tested:
...