MySQL is an open-source, relational database management system.
0
votes
1answer
189 views
Only allow user to access a link once a year, based on their joining date
I am using Wordpress to run a membership site, and one of the features is that members can download a badge. However, they are only allowed to download the badge once per year, starting form the date ...
0
votes
2answers
1k views
MySQL: Possible to replace all of wp_posts.post_content(id#) via UPDATE + REPLACE + SELECT?
EDIT: I want to update one field (post_content) within a known record (id of 4) of a known table (wp_posts) in a new database (new_db). The update has to come from one field (post_content) within a ...
0
votes
2answers
220 views
Deleting post tags removes categories
I'm trying to remove old post tags from a few WP installs. In some instances, I have over 20k tags for a few thousand posts. I've tried the following code:
delete t.*,tt.*,tr.*
FROM wp_terms AS t
...
0
votes
2answers
62 views
Removal of all posts content in bulk, keeping the posts itself
How to, using PHP scripting or WordPress overwrite all of the posts (permamently, so it takes effect on database) with some static text such as "Content removed."?
0
votes
1answer
426 views
SQL error with custom query
I'm trying to create a custom post query for sorting posts that have been voted "thumbs up".
I'm joining my custom "wp_post_votes" table (which stores the number of votes each post received) with ...
0
votes
1answer
989 views
add_action for publish_post doesn't work
I'm working on a personal voting plugin, I don't intend to release it publicly because I'm still learning WP.
In general, you can vote posts "up" or "down". I have 2 tables, one collects IPs (to ...
0
votes
1answer
644 views
query_posts meta_key with current date
How to query Post with current date month with custom field:
Here is my code
<?php
global $wp_query;
$event_month = get_post_meta($wp_query->post->ID, 'eventdate', true); ...
0
votes
1answer
437 views
saving the widgets position after drag and drop
I have created a web application in which I have 3 columns, or i would say left sidebar, right sidebar and a middle widget area, I have few widgets in the left sidebar, few in the right sidebar and ...
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 ...
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
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
152 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
2answers
68 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
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:
...
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
69 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
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
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
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
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 ...
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!
0
votes
0answers
50 views
Use $_GET with permalinks on page
I'm currently trying to use a $_GET to populate a MySQL query with in a URL on another page within a Wordpress site.
URL sample:
<a href="http://site.com/file.php?alabama">Alabama</a>
...
0
votes
0answers
39 views
Do someone know how to fetch post images sizes via MYSQL Query?
i am developing a web-services using PHP with adodb classes. what i trying to do is that i need the image sizes of the post i.e(thumbnail, medium, large) size. I am able to fetch the post original ...
0
votes
1answer
17 views
Convert many posts from having a specific meta_key to use a post_format
I have 350 posts that were using a plugin-provided option stored in a meta_key ("custom_post_template", to be precise).
I want to convert these posts to assign them a specific post_format ...
0
votes
0answers
12 views
Mysql Like doesn't work with prepare? [duplicate]
i need to get a result using LIKE in mysql , so i have write code like below
$sql = $wpdb->prepare( "SELECT nr, homeTeamId, awayTeamId, homeScore, awayScore
FROM ...
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
...
0
votes
1answer
26 views
Problem with a query in custom posts
I'm making a search form to select available rooms.
I have a custom post for the rooms called "Products" and a post meta value called "availability" (format: Y-m-d).
And I want to find all rooms ...
0
votes
1answer
132 views
Running Wordpress from MySQL Cluster with HAPRoxy
I'm trying to install a wordpress installation where the DB will sit on a MySQL cluster (Galera/Percona XtraDB Cluster) and connected through HAProxy.
Everything outside of the Wordpress install ...
0
votes
0answers
52 views
using wordpress page templates programmatically
hello I am having a dilemma with a wordpress plugin, its more logic than a code problem so I hope you guys can still help me. over all here is the function of the plugin, again all code works fine ...
0
votes
0answers
45 views
Custom Wordpress Meta Query
I have a post type (course) that has some meta data associated with it, namely the following two:
City and State
The two pieces of data above are stored in the postmeta table, with meta_keys ...
0
votes
1answer
34 views
Mysql query and odd results
I've a query here :
$sql = "SELECT ID,post_title,post_content,post_date,post_type
FROM {$wpdb->posts}
WHERE post_content LIKE {$stuff}
AND post_status = 'publish'
AND post_type = ...
0
votes
1answer
26 views
Filtering problem
I got the custom_post_type_data in which I store some variables when I make a new post. Variables likes Author, Price etc.
I implemented a filtering by author, so when you click on James (for ...
0
votes
2answers
75 views
WordPress Site - Connection to MySQL Database: The Basics [closed]
What is/are the best source/s to check to find the nuts and bolts of connecting a MySQL database to my WordPress website? Thanks.
0
votes
1answer
63 views
How to back-up a database on IIS
I've been having trouble finding a good tutorial on how to back-up a WordPress database using IIS as the web server. I installed WordPress using IIS's web platform installer and now I can't even find ...
0
votes
1answer
90 views
Contact form with database integration issue
This is more a question about the idea I am going to share and ask for advice for.
I would like to have a contact form on my site, where people complete their data and it gets stored inside a ...
0
votes
1answer
41 views
finding out the top 5 source ( source is a custom taxonomy ), in a given category
The client I'm working with have thousands of articles and media ( audio/video ) files.
To WordPress, all are posted by Author ID 1, which we named as STAFF.
All the content though in reality has ...
0
votes
1answer
62 views
How to check for empty and not a failure
I'm querying the postmeta table to see if a url has already been entered, using this statement (where $thisLink is the url I'm checking)
$mypostids = $wpdb->get_results("select * from ...
0
votes
1answer
81 views
How WP decide to show or not to show in admin panel the pop-up window with hint? Need a fix
To all newcommers the WP3.5 show the floating hint about new abilities of 3.5 version placed on top left coner of screen saying:
We’ve combined the admin bar and the old Dashboard header into ...
0
votes
1answer
85 views
Using custom tables for old posts
I have a site with about 24,000 posts and 200 posts daily and the database will get huge soon. So I plan to transfer the old posts to custom tables to reduce the database load. There's no need to show ...
0
votes
1answer
22 views
Assign a tag to custom post type using a query
I have a custom post type courses with a custom field level. I want to run a query (mysql or WP query) that runs through every course (post) and if the level is greater than 3, append a tag called ...
0
votes
2answers
105 views
How to update wp_posts with just the returned comment count from wp_comments (SQL GROUP BY)
I am doing a special migration from someone's custom CMS to a WP installation. I successfully got the posts and comments migrated into their respective tables. Now I need to get the comment count ...
0
votes
1answer
139 views
SQL query - get ids - Advanced Custom Fields / WPeC
I need to query the database on add_action( 'init', '...') to find post ids with the field 'product_discount_option' set to true.
I know at least one of my product posts have the field ...
0
votes
0answers
47 views
What is a good database backup? [closed]
I am transfering my site to another site (different server and domain) and would like to export my previous database. I am following these steps. When exporting my database the first time. I had a ...
0
votes
1answer
54 views
Does WordPress cache get_user_meta() results?
If I call get_user_meta() to retrieve a value, does WordPress cache the value? If I call get_user_meta() to retrieve the same value, does WordPress have to query the database again or is it stored in ...
0
votes
1answer
56 views
sql for querying post and their category
I'm trying to query the wordpress database for the post and what category they belong in. Is there a sql query that I can use for this?
Thanks,
0
votes
0answers
6 views
What would make a MySQL database create tables in a different collation other than its default? [duplicate]
Possible Duplicate:
Using wpdb to connect to a separate database
am adding tables to a Wordpress database on my localhost and it is changing my collation from utf8_general_ci to ...


