Questions tagged [mysql]

MySQL is an open-source, relational database management system.

Filter by
Sorted by
Tagged with
0
votes
1answer
617 views

Processing forms with php to wordpress database

I'm simply trying to process data from an html form into my wordpress database through php. I've tried multiple times to get the data inserted but have had no luck. The setup is as follows: Database ...
0
votes
2answers
817 views

live site do not update after importing sql database

My live website is not updating after importing sql database from wamp local server until last time all went perfect but last night I was not able to see the changes live made in local. what I did: -...
0
votes
1answer
589 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 ...
1
vote
2answers
411 views

Get url of product's images (woocommerce)

What happen when a post (product) didnt have a guid,because it has the same image with another product ? For example: Query1: select guid from wp_posts where post_type='attachment' and ...
0
votes
0answers
26 views

update multiple rows in mysqli table base on two values

I know this is an old question that is repeated here a lot. but I couldn't find an answer that works, and my code is really bad. How can i update multiple rows in one query when i have to use two ...
1
vote
2answers
1k views

How do I transfer user passwords from one WordPress site to another?

Let me begin by saying I know this is generally advised against but I'm in a tough spot at work where this is essentially being demanded and to my understanding it's theoretically possible. I am ...
0
votes
0answers
24 views

wpdb insert into point column in db

I am struggling to insert a combination of lat and lng into a point column in my database. I am trying the following, but i always get an error "cannot get geometry object from data you send to the ...
0
votes
1answer
526 views

$wpdb->prepare is not working like mysql_real_escape_string

I'm working on a WordPress plugin and recently I have planned to migrate from SQL to $wpdb. I'm using a method called $wpdb->prepare instead of mysql_real_escape_string but it does not work. Here ...
0
votes
2answers
630 views

how to check for wordpress Query errors

In mysql or mysqli you can add this type of Query: <?php $sql = mysqli_query($con, Insert into database itt (name) VALUES ($name)") or die(mysqli_error($con)); ?> What does wordpress do ...
2
votes
1answer
89 views

Is it useful to turn on MySQL query cache for performance

Now the MySQL default query cache is disabled, as I remember long time ago, the hit rate of MySQL is quite high when running WordPress. So I am thinking if enable it now will improve performance, ...
0
votes
1answer
14 views

One of two similar WP Query is very slow

I have two WP Query are very similar. one is fast and another is very very slow. I have already test two query via mysql directly. the fast one: SELECT wp_posts.* FROM wp_posts INNER JOIN ...
0
votes
0answers
21 views

find and replace shortcode sql database

I've been trying to replace this shortcode [RICH_REVIEWS_SHOW category=”all” num=”6″] with this shortcode [site_reviews summary count="3" hide="date"] but I'm failing miserably. I've used this ...
0
votes
1answer
654 views

Add value to array in database

I have a custom database in my WordPress site where I want to save multiple values to one row. Let's say I have an entry: id: auto increment pageid: id of current page time: text (is an array ...
1
vote
1answer
654 views

Wp query show post by author name or post title or post content

I have to create a search query which allows me to filter all posts where author name and post titles or post content has the word from search textbox. So if i search wordpress it should list all the ...
0
votes
1answer
756 views

Checking for new message using AJAX and PHP. Server overload?

I wrote a script (it may not be perfect, I'm newbie) to check for new message (using ArrowChat and Buddypress) every X mins. It works good, but I'm worried will it overload my server? It's shared. ...
1
vote
1answer
688 views

Separate DB by yearly archive of Wordpress

I have large DB of blog post I already export it by year and wanted to make archive by year doing it on subdomain, like 2012.mysite.com I stack looking for solution on internet, I wondering if their ...
0
votes
0answers
66 views

Query product's image path by category WooCommerce database?

I am writing a small query to grab image path and object ID from Woo_Commerce database. I am join taxonomy and relationship table to achieve this but somehow I am making mistake I can't realize. I ...
0
votes
0answers
17 views

wordpress insert post without actions/hooks

I am developing a custom importer for WordPress (because we have a very custom setup and the available tools don't seem to work for our scenario). During this import, I'd like to disable any hooks ...
0
votes
1answer
1k views

Export Yoast Keywords from MySQL/phpMyAdmin

I'd like to export all focus keywords from Yoast, as we're moving platforms to Craft CMS and using a similar tool, Ethercreative's SEO tool. I'd love a good query to pull these from the database, ...
0
votes
1answer
26 views

How to get the list of WooCommerce product image of a certain category from database?

I am trying to display WC product images (thumbnails) or just get the url to that image from database. But I can't seem to find the column where the url are stored with the following. One thing I want ...
-2
votes
1answer
24 views

Create a Wordpress Database query to find users who purchased specific product through WooCommerce [closed]

I am working with a company that provides online content in the form of semesters you pay to access. The semester is set up like a product that you purchase through WooCommerce. We've been applying a ...
0
votes
0answers
13 views

Warning messages appearing on website relating to ajax-portfolio/lib/gravity-fields [closed]

Hoping someone can assist, I have a website where I am experiencing the following warning messages and unsure what is causing this issue and how to rectify it. Warning: mysql_real_escape_string(): ...
0
votes
4answers
2k views

Error establishing a database connection - with Debug Data

my site started acting up a few days ago, running the debug I get these lines. Tried to mess around with the DB but couldn't get my head through it. Do you have any idea what those lines imply? ...
0
votes
5answers
16k views

Manually delete post from database

For whatever reason, I have a post and a page with the same slug name and it causes the db to hang. I can't alter the slug on either so I need to go manually delete the posts from the database and ...
0
votes
1answer
764 views

Custom redirects with using SQL

We have pages with urls like this: http://example.com/?page_id=3&user_id=5 http://example.com/?page_id=6&user_id=9 etc. page_id and user_id located in table MySQL Database. And this table has the ...
11
votes
9answers
22k views

How to replace the domain name in a Wordpress database?

I have a Wordpress database which was installed in a development environment... thus, all references to the site itself have a fixed IP address (say 192.168.16.2). Now, I have to migrate that database ...
1
vote
1answer
633 views

How to set up an auto delete post?

I want to create a form in which when a front-end sets a date and on that date the post gets automatically deleted. Is it possible?
0
votes
2answers
24 views

I want to share local developement and staging DB — Is this very smart or very stupid?

Basically: I want my work to be meaningful and efficient. I am considering making my local development AND staging database the same thing. I would develop on my local machine but have the SQL data ...
0
votes
0answers
22 views

SQL. Select category descendants

How does Wordpress fetches subcategories for a given category? I tried to figure it out from the code, but I have not succeeded. My real question is: is it possible to make some recursive sql query ...
1
vote
1answer
711 views

Connect to MySQL using Windows Authentication

Is it possible to have Wordpress/PHP connect to my MySQL database using Windows Authentication on IIS? I can connect just fine using the normal MySQL command line utilities. I get the following error ...
0
votes
1answer
15 views

Error Connecting to Database WHEN Installing Wordpress on XAMPP [Tried All the Usual Stuff] (Pics Included)

Here's the error I get https://gyazo.com/56134064606564c836ae8b0f18a129ba Here's the DB login settings I used: https://gyazo.com/2facfe11765bc4b887c31bc111bb123a Here's my DB names and users: ...
0
votes
1answer
24 views

use mysql variable in a $wpdb->query to reindex a column?

I have this MySQL query, which do work in PHPMyAdmin: set @ROW = 0;UPDATE `wp_wpsstm_subtracks` SET `subtrack_order` = @ROW := @ROW+1 WHERE tracklist_id='176226' ORDER BY `subtrack_time` ASC I would ...
1
vote
0answers
42 views

Error: MySQL shutdown unexpectedly

i see this error in my xampp/mysql/logs. what shoud i do? 2019-09-18 16:06:13 0 [Note] InnoDB: Completed initialization of buffer pool 2019-09-18 16:06:13 0 [ERROR] InnoDB: Cannot create log files ...
1
vote
1answer
39 views

Uncaught Error: Call to undefined function mysql_connect() - Wordpress installation

Trying to install wordpress without xamp on my local machine. Version info: Wordpress: 5.2.3 PHP: 7.3.9 Apache: 2.4.41 When accessing this url -http://localhost:8080/wordpress/wp-admin/install.php, ...
1
vote
1answer
905 views

Replacing mysql_escape_string in a custom plugin when moving to PHP7

I have a custom developed plugin for a wordpress website that is an online car community on php5.6. I didn't develop the site originally but am now the custodian. I have limited programming ...
0
votes
1answer
1k views

How to add a custom field and incrementing value for all the published posts

I'm trying to add a custom field value "article" and auto - increment value starting from 1 for all the published and new post starting from the first post. I'm trying with the below code in Mysql. ...
0
votes
0answers
59 views

Not getting ajax success response on insert/update row to database

I am not getting success response after inserting/updating record to the database. Instead ajax returning error: function(response) with Something went wrong! message. $this->gs_db is the ...
0
votes
0answers
8 views

Import Custom Taxonomy Tags From Custom Post Type To Post_Tags

I have a custom post type called 'Bookmark' which uses both the default Post_Tags and also have a taxonomy called 'Bookmark_Tags'. I would like to import all the Bookmark_Tags into the Post_Tags ...
1
vote
2answers
2k views

How to get last updated row or ID in wordpress

How to get last updated row or ID in wordpress. Like : $wpdb->insert_id;
1
vote
2answers
912 views

How to import a custom MySQL DB table into a WordPress custom post type

What I've done so far is create a plugin that creates a custom post type, takes a field(ID from the custom DB) and also creates a couple of page templates. I have a custom MySQL DB that is on the ...
0
votes
0answers
9 views

Sorting posts By Taxonomy using 'post_clause' filter

I have a table list in my plugin's admin panel that has taxonomy columns. I'm trying to add some sorting functionality for those columns and I'm using the post_clause filter to alter the query to ...
0
votes
1answer
1k views

MySQL query for taxonomy-meta

I am working directly with MySQL, using MySQL workbench. Can you help me write a SQL query that will pull all custom taxonomies and their term-meta fields? I have a custom taxonomy called(slug) ...
0
votes
1answer
12 views

MySQL update text field with '

I need to be able to have a charvar field that contains an apostrophe like Woody's. I'm using wp_list_table to simplify the editing of the table. After making the update, the field contains Woody/'s. ...
0
votes
2answers
1k views

How to pass username into form that sends data to database

I am trying to pass username to database through form: [insert_php] $current_user= wp_get_current_user(); $id= $current_user->user_login; [/insert_php] <input type="hidden" name="id" value="[...
0
votes
1answer
961 views

wp_insert_user is not working for me?

I have written a code for inserting wordpress user if I try to add new user I am getting an error for wp_insert_user like below : "Catchable fatal error: Object of class WP_Error could not be ...
0
votes
1answer
948 views

Update post meta data (custom field) by post link

I have a post in my WordPress website, which has lot of custom fields. I have an Excel sheet with "post link" - "custom field data" combination. That custom field (video URL) is already set for each ...
0
votes
0answers
13 views

Get count of posts by authors with Editor role between dates

I'm trying to find a query that can give me the count of posts made during 2019, but only if the author is an editor (I don't want posts by subscribers). I would like to also show the count by author'...
11
votes
2answers
11k views

Why are simple updates to wp_postmeta's “_edit_lock” so slow?

In our MySQL slow query log, the cumulatively slowest query is a simple update to wp_postmeta. Here's an example: UPDATE `wp_postmeta` SET `meta_value` = '1392835505:386' WHERE `post_id` = 94705 ...
0
votes
1answer
24 views

Hide posts if user is added to it WP_query

I have this list of posts in wordpress. I've made a favorite function that when you mark something as favorite it gets added to the front of the line. The issue here is I run this 2 place. One top ...
1
vote
1answer
413 views

Create table from array with prepare

Is it possible to create a table with the wpdb::prepare function? I read the documentation and tried to find examples but there where none that helped me. Even creating a table with prepare doesn't ...