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

learn more… | top users | synonyms

0
votes
1answer
24 views

How do I display offsite database info on my wordpress site?

I host some online games from my personal computer which the game saves information to my Mysql database. I would like to display live data (if possible) on my hosted Wordpress site. I know the ...
0
votes
1answer
28 views

HTML Entities in Post Title

I'm inserting posts into wordpress using a script which is loaded through CRON. Before inserting each post I am checking whether the post with the same title exists or not. Below is the snippet I'm ...
0
votes
2answers
31 views

making php value numeric

I used some of this code from this page on Stack Overflow: Using wp_query is it possible to orderby taxonomy? It's about the function to be able to sort a query by a taxonomy value. Although it works ...
2
votes
1answer
152 views

Grouping related postmeta data via SQL query

I am using someone else's WP plugin which stores lots of related data in wp_postmeta using an "artificial key". So effectively we hijack wp_postmeta to create a nested relational database. So one row ...
4
votes
2answers
59 views

How to log mysql errors from wordpress core?

I am developing a wordpress site and I would like to be able to log and handle mysql errors from wordpress core. My site has a mix of wordpress pages and posts + a few php pages that run under the ...
0
votes
1answer
24 views

Best practice to limit results in get_row()?

This is my query to check if a title exists (it's in a loop, therefore [$i]). $wpdb->get_row("SELECT * FROM wp_posts WHERE post_title = '" . $titles_arr[$i] . "'", 'ARRAY_A'); Anyway, I would ...
0
votes
1answer
336 views

the_author_meta not working

I'm trying to use the_author_meta to retrieve some links which users can set in their profile. I set up extra profile fields and they are saving to the database. On my author.php I have the ...
1
vote
1answer
479 views

Get multiple custom field values in a $wpdb query [duplicate]

Possible Duplicate: How to query posts based on lat-lng coordinate as post meta? I want to create a $wpdb query that select the closest places (custom post type) near the current ...
0
votes
1answer
106 views

Efficiently loop over huge number of posts

I want to loop all posts to do some processing, but one of my concern is there are many posts and it might used up my memory, so I want to loop posts with offset, something like paging. e.g. $posts ...
0
votes
1answer
304 views

Advanced Custom Fields Array Population

I'm trying to populate a ACF select field with an array from a custom $wpdb->get_results call, which is essentially a list of categories from my db. I have the following: global $wpdb; ...
0
votes
1answer
132 views

Pull post name from value of a specific meta key

I am looking for help on how to pull post name from custom field value for example in wp_posts post id = 200, and there are corresponding meta key and values with post_id= 200 in wp_postmeta I want ...
2
votes
2answers
313 views

mysql custom wp query

this code is designed to select posts with selected meta value in wordpress query <?php $values = $wpdb->get_results("SELECT DISTINCT meta_value FROM $wpdb->postmeta WHERE meta_key = ...
1
vote
2answers
50 views

wp_insert_post sometimes fails after API call

I have built a plugin that fires an Ajax call to connect to a third-party API. That API returns some Json, which I then save as a custom post with wp_insert_post. Now, usually, this works. But, now ...
1
vote
1answer
825 views

How to get a Google maps SQL->XML->map marker tutorial to work in WordPress

I have been trying to figure out what is wrong with my code for a couple days now, and I cant seem to crack it. I am trying to follow this tutorial: ...
1
vote
1answer
192 views

How to let a user choose an authors and save it to the database?

I have a multi-author Wordpress site which reads different rss feeds and posts them to my page. I was wondering if it is possible to make a code that would provide an opportunity to registered user ...
1
vote
1answer
44 views

Mysql query and order meta value

I made a mysql query to WordPress like this: $querystr = " SELECT $wpdb->posts.* FROM $wpdb->posts, $wpdb->postmeta WHERE $wpdb->posts.ID = $wpdb->postmeta.post_id AND ...
-1
votes
1answer
50 views

Custom SQL Query for Wordpress page

I'm quite new to wordpress. I'm trying to build a tableview within a wordpress page. Therfore I need a custom SQL Query to my MySQL Database. Query data from my MySQL Database Get the result somehow ...
1
vote
1answer
39 views

Universal problem: first request after ~25 second inactivity always slower (~1 second) than subsequent requests (~1/10sec)

It's something I noticed ever since I started working with WordPress. It's a universal issue, in the sense that it doesn't matter if the WP installation is on my shared hosting account (haven't tried ...
1
vote
1answer
53 views

How to prevent execution of default query, while preserving ability to use WP_Query in template?

PROBLEM: I'am trying to prevent execution of default WordPress query for custom category template. I have found a possible solution, but looks like it preventing execution of all post queries: ...
2
votes
2answers
477 views

Check if post of title already exists

I'm writing a plugin that takes an xml feed and posts it into WordPress using wp-cron Everything is working dandy, except it keeps adding the same posts over again. So, I'm working on a system to ...
1
vote
2answers
68 views

Error establishing database connection - high traffic?

I have a WordPress 3.5.1 site that's getting a little bit of traffic (80 concurrent visitors, ~5 clicks/pageviews per second). The site runs fine until it spikes to ~85 visitors. There are usually 4 ...
-1
votes
1answer
79 views

How can I debug my database connection for unit testing?

I've set up a wordpress environment on my Mac with MAMP and I'm running 3.5.1 locally (i.e. http://localhost:8888/blog works). I'm trying to run the unit test suit from wordpress.org and having ...
0
votes
1answer
33 views

Print output of Table Creation

I am creating a few tables and I getting the following message: The plugin generated 440 characters of unexpected output during activation. If you notice “headers already sent” messages, ...
0
votes
0answers
14 views

SQL overload - weird query [migrated]

My hoster claims the following SQL query is overloading the server and causing it to perform slowly and threatens to disable my account. I can't seem to find a bottleneck - can anyone help me detect ...
0
votes
0answers
35 views

Using HyperDB to connect to a MS SQL database

I have successfully split my WordPress database into two MySQL databases (using hyperDB). And it works well. Now I want to dive into the unknown and have one database use MYSQL and the other MS ...
0
votes
0answers
29 views

Wordpress post saves until Apostrophe (’) is used

I've installed wordpress onto a fresh VPS with nginx + php-fpm, the installation works fine apart from whenever I post something with a ’ the post ends there. It's looks to be some sort of escape ...
0
votes
1answer
1k views

Query to delete all featured images and remove post meta?

I'd like to run an SQL query to find all featured images from posts and delete the file itself and any references to it. Can anyone tell me how to accomplish this? Many thanks!
1
vote
2answers
774 views

Help with MySQL to $WPDB query

Here's my issue. I have three tables I'd like to query - states, points, and state_points. States contains stateid, and name. Points: pointid, pointlat, pointlng. State_points: Stateid, Pointid. ...
1
vote
2answers
434 views

Import 10,000 Users into Wordpress WITH a specific ID for each user

I have a website which has about 10,000 users. I am converting this site over to Wordpress. The new site is ready to roll, but I have to bring over all the users. There are a number of plugins ...
0
votes
2answers
69 views

How to copy post titles to post slug in phpmyadmin

I just imported 1000 post into a custom post type on a site and the slugs are all blank. There is a problem with the importing plugin i'm using. My SQL is weak :-/ know what i need to do but not sure ...
0
votes
0answers
60 views

Custom query on Wordpress custom table

I am working with a custom table where some values will be inserted or updated if they already exists, I have checked and rechecked the syntax and it seems to be working fine, if I run the same query ...
0
votes
0answers
154 views

Creating a custom Jquery modal form to upload data in wordpress 3.5.1 [closed]

i am new to jquery.I looked to various demos but can't find what i am looking for. I want to add a upload item feature in my wordpress website.This feature is available to the end user after he/she ...
0
votes
0answers
25 views

Automatically create a user with author rights from outside of Wp-admin

Need to create a user on the fly based on the following steps... User clicks a link in an email with a unique url such as 1234.domain.com/?auth=42344245534534535 when the user clicks through to ...
0
votes
0answers
33 views

Wordpress and BigDump

I am having a bit of a nightmare situation. I was given a testarea on a subdirectory of a friend's client server as a temporary favor in order to test my wordpress site. The path is as follows: ...
5
votes
8answers
4k 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 ...
0
votes
3answers
30 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, ...
0
votes
2answers
70 views

MySQL Syntax Error upon restoring database from backup

Performed a bad import to my Wordpress install and decided to restore from the mqSQL backup (full export) I had made minutes earlier. Dropped all tables in the database and then did an import from my ...
0
votes
1answer
50 views

Woocommerce: Grab total revenue of a product over all orders

I need to display the total revenue of all orders for my products depending on if the logged-in user is the author of the product or not. I can't use the Quantity field as a multiplier either because ...
0
votes
2answers
1k views

Mysqldump add drop table?

I notice in the Codex that the --add-drop-table option is displayed for backing up a database. Before I screw anything up, does this just mean that when the backup is eventually imported, the tables ...
0
votes
1answer
47 views

Creating Database Table vs. Adding MetaData to Post & User

I am creating some event functionality for my wordpress site. Each event will have a set of tickets associated with it. A user who is purchased at least one ticket will additionally have a set of ...
0
votes
0answers
12 views

instantwp how to shutdown mysql for testing?

I am using instantwp for a standalone project and i need to try out the follow scenario/problem: "instantwp seems to be running but WP can't established a database connection" This happened to me by ...
0
votes
0answers
31 views

query optimization and benchmarking question to fetch term_taxonomy_id for the provided `name` of term

I have been writing a some plugin for which I need to fetch the term_taxonomy_id from the term_taxonomy table of WordPress for the provided term name. Though I tried to benchmark them but in best and ...
0
votes
1answer
27 views

Database create or redirect

I am working on a site ABC.com, I have only access to the root folder. I am planning to install wordpress. I need to somehow create a database without any cPanel. or the second option that comes in ...
0
votes
0answers
52 views

How to retrieve data from google places api and save it in mysql database? [closed]

Hi I am developing an android app for blind people where I want to send the nearby locations and bus stops to the user. I don't want to use google map to display palces in our app but I need to send ...
-3
votes
1answer
20 views

get value from mysql [closed]

i am using this code: <?php define('WP_USE_THEMES', false); require('./wp-blog-header.php'); global $wpdb; $varrriable = $wpdb->get_var("SELECT ID FROM $wpdb->posts WHERE post_title = ...
0
votes
0answers
23 views

Dissapered all posts by 2013 year

Dissaperd all posts posted in 2013. There are no posts, images and tags for this year. I've checked it in the phpMyAdmin and find them. But they don't shows in administrtor panel. Any idea? Thanks!
1
vote
1answer
39 views

Pushing stored procedure to a multisite database in WordPress

I am given a WordPress multisite and need to extract information from the site. I have written a stored procedure that recursively builds a tree relationship for posts of a certain kind. Now I am ...
-2
votes
1answer
82 views

Woocommerce - Bulk Edit Stock Level

I have 30k products in my Woocommerce store. And I would like to mass edit all products to become "out of stock" before I add new batches of products. Can anyone please let me know how to do it in ...
1
vote
1answer
123 views

Large database causes slow load

I have a 2GB WordPress database (using InnoDB Storage Engine) and I noticed my site loads slow when I press the publish button right after I selected a featured image in the media library. I had a ...
0
votes
1answer
43 views

How do I Split one Table into to lists for two seperate drop down boxes

I am driving myself crazy trying to find an answer, although I know it would most likely be something simple.\ I have a mysql table with the following columns: id first_name family_name ...

1 2 3 4 5 7