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

learn more… | top users | synonyms

1
vote
3answers
46 views

How to fetch Data in WordPress using MySQLi or $wpdb

I have custom table like this: useraw 1. id (Primary*) 2. user_ip 3. post_id 4. time I am inserting data in the table using $wpdb->insert($table_name , array('user_ip' => $user_ip, '...
1
vote
1answer
23 views

Performance when getting post meta for post retrieved by meta value

I have a meta key which I would like to use to get all post meta data for a post where that one meta key matches a specific value, in one go. Example: Post 1 has a meta_key called unique_number. I ...
0
votes
1answer
22 views

pagination on data fetched using SQL query

I am new with php and word press. I have a question that I am using a sql query in my posts to get data from my data base. Now the problem is that I have huge data on my post and I do not have idea ...
1
vote
1answer
413 views

Wordpress with php5-fpm and nginx

I am trying to complete an install of wordpress using php5-fpm and nginx, with a database on a remote server. However, wordpress doesn't recognize the existence of mysql to allow me to connect to the ...
1
vote
1answer
20 views

Display data on Word Press site posts and pages from mysql table

I am new with word press and I have a table in phpmyadmin which has the data which i want to display in my word press site on different posts and pages. I have searched a lot around and came up with a ...
0
votes
1answer
1k views

Create an user on external database

I have wordpress site and a project management system from codecanyon. Here is the link I have disabled registration for users in project managment system, only login is enabled. I need to make users ...
0
votes
1answer
1k views

Group posts by meta_key

I have a Problem with grouping meta_values. The Query looks for posts with the meta key "company". I want a unique listing of the colors like: blue red yellow array_unique was not successful and also ...
1
vote
3answers
78 views

Add user data to table when user is created?

I am trying to figure out how to add user information and specific meta data to a separate table through PHP. I would prefer to do this when a user posted to the wp_users and wp_usermeta table. I am ...
1
vote
1answer
18 views

Move value of one custom field to another

I've one custom field named as "video" and I want to copy the custom field value to my another custom field named as "theme2035_embed." I could do it manually, but since I have more than 2500 posts ...
2
votes
3answers
2k views

importing users where password is provided as md5 + much metadata

I have a spreadsheet that was provided to me of users to import to a new site I have built. I was provided with the password in MD5 hash form. I suspect if I insert this into the password field in ...
0
votes
3answers
55 views

How to properly insert data into custom table via plugin

I have a plugin that reads data from an uploaded file and runs queries on the wp database. These inserts are into a table created by my plugin, so they aren't the post type. This is how I got it ...
4
votes
2answers
37k views

Connect to database using wordpress wp-config file

How can I connect to the database using the wp-config.php file ? I'm trying to make a script more Wordpress friendly, and I need to connect to the database, but without installing the script as a ...
2
votes
2answers
549 views

wp_admin edit.php slow with lots of queries

I have about 4,000 posts. Currently when I click on All Posts (edit.php) it's taking about 10 seconds to load and I'm showing approximately 1000 queries! Most of them look like... SELECT t.*, tt.* ...
0
votes
1answer
657 views

How Do I Merge Categories With phpMyAdmin

I tried the following phpMyAdmin query to merge my category 112747 into my category 112748: UPDATE wp_term_relationships SET term_taxonomy_id = 112747 WHERE term_taxonomy_id = 112748; It did not ...
1
vote
2answers
576 views

How to optimize 'select found_rows()' query? Several 'high load average' alerts daily

I have 5,000 regular posts, 6,000 posts in one post type and 2,000 posts in another post type. Needless to say, that has made the wp_posts table quite large. Not to mention, I have custom taxonomies ...
0
votes
2answers
566 views

WordPress get pagination on wpdb get_results

How do I gee the numbered pagination of custom wpdb result? below code will show one latest post from each authors in the site. I want to show 20 posts per page with a numbered pagination. $postids ...
0
votes
1answer
458 views

Inserting Post Meta From SQL

I'm trying to get post meta to be updated/replaced with $wpdb and running into issues. I have working SQL, but cannot get it work when coding it up for my WP plugin. Extra note: The post meta being ...
1
vote
1answer
28 views

Can't get wp_insert_post to work

I'm trying to code a loop that will post articles from a SQL database. However, whenever I try to load the page I get a 500 error and nothing is showing up in the error logs. Code: <?php define('...
-2
votes
0answers
19 views

Hoping someone could explain some queries for me

The following queries are considerably slow on my site and I'm hoping someone could explain them to the best of their ability (what they're doing/requesting). SELECT SQL_CALC_FOUND_ROWS wp_posts.ID ...
0
votes
1answer
15 views

I'm trying to create a custom version of the wp_list_authors function that includes custom post types

I'm trying to create a custom version of the wp_list_authors function that includes custom post types. I have 3 authors on the site I'm working on (www.healthyeatingadventure.org). Two of them only ...
0
votes
0answers
7 views

WP-CLI's wp db create doesn't have privileges to DB_USER

Before I ran wp db create I manually created a new mysql user called kenyutso. I granted this user global privileges to create databases or else there would be an error when I do wp db create because ...
0
votes
1answer
478 views

“Error 1064” when importing msql database after updating wordpress version to 4.2.1

I have a error in importing my sql file that contains the db of my site When i export from local, is ok my settings Server: mysql wampserver (127.0.0.1 via TCP/IP) Server type: MySQL Server version: ...
0
votes
1answer
27 views

Comment Approve - Add custom function when comment is approved

I would like to save some PHP memory when quering category page (like 5000 products at once) with average review rating, so I would like to save average rating of reviews every time I will manually ...
0
votes
3answers
852 views

Fetch a single row from a custom table for to a given ID

When I want to get a single row from a custom table of my WordPress database by providing a username through function call, it does not work. When I mention the username in where clause of the query, ...
7
votes
2answers
7k views

WordPress mysqli and PDO

Does WordPress code base use mysqli or PDO? I know PDO is superior to mysqli but mysqli is not bad neither. Plus from one of the features of what makes PDO is superior to mysqli ( that is being ...
0
votes
1answer
459 views

Query to change custom post type with specific category

I need to change several hundred posts with custom post types to regular post type but only from one category within that custom post type. So I have a custom post type 'films' and within that post ...
0
votes
3answers
50 views

Stumped on migration

I'm migrating a site from my server to a client's Bluehost (ugh) account. I've tried using All In One WP Migrate BackupBuddy manual migration (copying files & exporting a db using WP Migrate DB) ...
4
votes
7answers
2k views

WordPress MySQL & PHP Performance

have a website (www.americanbankingnews.com) that gets 40,000-50,000 page views today. It's currently sitting on a dedicated quad-core Xeon server with 8GB of ram. The site is powered by WordPress and ...
1
vote
0answers
439 views

SQL query equivalent to WP User Query

I have the following WP user query code: //Get all users sorted by whatever $sorted_users = new WP_User_Query(array( 'orderby' => 'meta_value', 'meta_key' => 'satisfaction_rating', '...
1
vote
1answer
35 views

UPDATE on SELECT results. A SQL query to swap Author with Meta Box value

I inherited a project where, for some reason, the previous developer make a custom post type for authors and a custom select listing all those authors cpt titles in the post edit screen. This led to a ...
0
votes
2answers
37 views

Export only pages and posts with mysql dump

How to export only pages and posts using mysql database to database approach? More precisely: what tables should one select for dump (I suppose wp-posts and wp-post-meta ) is it safe to export only ...
0
votes
1answer
30 views

How can I Use 2 databases with one WordPress install

What I'd like to do is have the regular WordPress application run from its regular database, and then have a separate database for a game server which will hold all game data. What I need is to make ...
0
votes
3answers
16k views

#1115 - Unknown character set: 'utf8mb4'

When I Import Mysql from local server to web ser it is showng me error 1115 - Unknown character set: 'utf8mb4' in Creating wordpress wp_comment table CREATE TABLE IF NOT EXISTS `wp_commentmeta` ( /...
0
votes
0answers
23 views

Pass the data from Custom Form in wordpress

How can I get the value from custom form in WordPress and stored into teh database? Here is my form. I used the bootstrap validator for this form. Now, what do I have to do to get data from this form? ...
7
votes
5answers
6k views

the_date() not working

I am using wordpress 3.2 and I did a query post like this: <?php query_posts("posts_per_page=1post=type&page=post_parent=10");?> Then I try to echo out the date of this post I queried ...
0
votes
1answer
30 views

How to make MySQL search queries with quotes

Hi everybody I run a wordpress based website and I'd like to store the search queries called by users to use them as analytics data to know what's most searched etc... So I have a custom table where ...
0
votes
0answers
26 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('...
0
votes
0answers
19 views

Override $table_prefix only for the options table

The only documentation i found was too obsolete. (https://wordpress.org/support/topic/two-sites-two-themes-one-database-same-content) and this one (Change options table prefix only) doesn't help me. ...
0
votes
0answers
38 views

How to generate notifications when MySQL data base changes

I am developing a WordPress multisite and I am wondering how I can generate notifications when MySQL database changes? For example the user in site #1 can sell his society. When he selected it, it ...
0
votes
0answers
21 views

wpdb->prepare clarification

Is there anything wrong with using wpdb->prepare() to retrieve items from a custom database table? Note how I've used prepare() below, without passing the $type variable through prepare(). I just ...
0
votes
0answers
32 views

How to change the capabilities from upper case to lower case, while inserting onto database?

I am trying to insert custom user roles like Student, Teacher and Parent. While inserting the capabilities into the database, it is displaying the role in uppercase. I am not able to fetch the user ...
2
votes
2answers
2k views

what to do when your WordPress database is too large?

Well I have asked this question in WP Forums, StackOverflow, and GoDaddy community as well, but nothing worked out. Hoping something is in here. I used 2 separated subdomains for my blog and site (...
1
vote
1answer
76 views

How to implement WP_List_Table? WP_List_Table giving array instead of a value in listing table

I am trying to implement WP_List_Table for my plugin. I have gone through this tutorial and using its sample plugin. I have installed this plugin and just changed table name and done slightly ...
-4
votes
1answer
148 views

How send simple push notification from php in android [closed]

I want to send android push notification from php. I have created admin in php & mysql when admin approve anything from admin than send notification to user.
0
votes
0answers
27 views

Sharing tables between 2 different websites based on the same database

I have 2 different websites installed on the same database. The 2 websites are sharing the users tables, but I want them to share the posts tables too. I tried to do it by editing wp-db.php. After ...
1
vote
1answer
51 views

How to bulk edit canonical url's in SQL?

I've been assigned to edit the canonical URL's (rel="canonical" found in the head)of about 600 posts on a client's site. Not all of the posts will use the same canonical url. Nor are these 301's or ...
0
votes
1answer
49 views

How to connect and insert data in database of wordpress?

On my website, there is a section called "My Ideal plank." It is a form where the user will enter their data and there will be a return message with the type of ideal board for the person. First ...
0
votes
0answers
21 views

Trim data before insert?

Recently I use this syntax to input data like below: $STRING_DATA = StrToLower(Trim($input_data)); $wpdb->query ( $wpdb->prepare ( 'SQL SYNTAX WITH PARAMETER STRING', $STRING_DATA ) ); Do I ...
0
votes
0answers
45 views

Advanced search query select from custom table

Hope that anyone can help me with this problem. I have 7 columns in my tbl2014wines custom Wordpress table. I am trying to create an advanced search feature that allows users to search by wine_name, ...
0
votes
0answers
110 views

I want to query for the 'post' and 'attachment' in wordpress using SQL query

How do I write a SQL query which will allow me to query for the 'post' and 'attachment' at the same time in MySQL? I am trying to get this information from the wordpress 'Posts' table. Please see my ...