MySQL is an open-source, relational database management system.
3
votes
2answers
451 views
Can i use php sql functions instead of $wpdb?
New to wordpress and was wondering why in Wordpress API do they tell you to use functions such as prepare(),insert(),get_col(),get_row(), query(), etc. when technically i can use the built in PHP sql ...
0
votes
2answers
761 views
Getting “Error Establishing a Database Connection” on localhost in new Mac OSX Lion environment
I just got a new Macbook Air and I've been manually migrating my files and code over from my old Macbook (instead of using Migration Assistant, to avoid bringing cruft).
I had several sites running ...
0
votes
1answer
248 views
SQL query not working in alphabetical post title/content search
I have an ajax request using wp_ajax sending one variable named "q" what I want to do is after the script get's the request to look inside the db and fetch the title and id of the corresponding posts ...
0
votes
2answers
405 views
How to Query Database for posts with certain Taxonomy Term
I want to write a select query to return data on only posts which have are associated with the taxonomy term food-and-beverage
SELECT wp_postmeta . * , wp_posts.post_name
FROM wp_posts, wp_postmeta, ...
2
votes
1answer
1k views
Get Previous & Next posts by Post ID
How can I go about getting the previous and next posts from outside the loop? Everything I try to do aside from the custom SELECT query (using get_posts or WP_Query) breaks stuff further down the ...
0
votes
1answer
103 views
get_var is neither a string, integer, or array …?
$vote_count = $wpdb->get_var($wpdb->prepare("SELECT votes FROM wp_mytable WHERE product = %s AND
company = %s", $product, $company));
...
0
votes
1answer
396 views
PHP variables in mysql query
What is the consensus on how to insert variables in a MySQL query using the $wpdb->insert syntax: ($table, array($column=>$value),$format)?
I know this hasn't worked:
...
0
votes
1answer
237 views
How to query / DB requests?
what is the correct way to query the a Wordpress database, meaning to pull row and column info, and then place it into a corresponding table in the Wordpress admin?
I'm wanting to do a query similar ...
0
votes
1answer
299 views
Query the links Database
Hi I'm trying to convert from a "example" wp_list_table that displays an array of data on the same page, to a "real life" table the pulls data from the database. I have the code setup to where I just ...
7
votes
3answers
320 views
What's a good strategy for planning Wordpress DB growth?
Hoping for some feedback on the topic of optimizing and staying on top of performance as a Wordpress database grows... to paint a picture.... let's say you have a wordpress / buddypress MU site that ...
0
votes
1answer
142 views
How to display results from a data table with an encrypted user id?
I'm trying to display a table of results for particular users who have submitted answers to quizzes. The problem is that the mysql database I am working with has a funky value for the user's ID.
I'm ...
1
vote
1answer
169 views
How is the data stored in the database?
I have years of experience with PHP and MySQL, but just starting to develop plugins for WordPress and need some help.
Currently, I am working on a plugin that will add extra functionality to another ...
6
votes
1answer
187 views
dbDelta support for FOREIGN KEY
On PHP 5.3.13/MySQL 5.5.21 the following code doesn't work:
if($check_custom_fields_form!=1){
$sql = "CREATE TABLE IF NOT EXISTS ". $table_custom_fields_form ." (
`form_name` ...
0
votes
1answer
542 views
Most viewed posts in Wordpress
I am owner of a blog/website and I am using this code for tracking post views in site :
function getPostViews($postID){
$count_key = 'post_views_count';
$count = get_post_meta($postID, ...
0
votes
1answer
193 views
Force Users To Relogin
I need a solution that i can use to force a user to logout via the admin panel of word press any help on this would be appreciated.
0
votes
1answer
322 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 ...
0
votes
1answer
125 views
Wordpress: Using the category slug get the category ID using mysql query
basically, I have a cookie with the category slug stored, using this data I want to query the database and return the ID of the category.
I am new to mysql and this seems like an advanced query that ...
3
votes
4answers
721 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 ...
1
vote
3answers
1k views
Will it break my site if I delete all transient records in wp_options table?
My site currently has an outrageous 500k+ transient records in the wp_options table.
This causes the table to be crashed frequently and so be my site.
I thought transient records will all expired ...
0
votes
1answer
348 views
Custom SELECT Query With Multiple Meta Values (Ordering Problem)
I have two custom meta values that I am using for an events list and have almost got everything working perfectly except for the ordering. I have two dates (event_date and event_enddate). One of these ...
0
votes
1answer
416 views
How to create Loop code for Menu using Wordpress?
I have created a menu called "My Menu" in wordpress using Menus feature provided under Wordpress admin panel. I have added 3 pages into it named Page A, Page B, Page C.
I have applied featured image ...
0
votes
1answer
37 views
Php Mysql Terms
I have configured wordpress in local system. I came across these terms in Phpmysql database under wp_options.
Can any one please tell me, what does it mean?
...
1
vote
1answer
2k 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 ...
1
vote
1answer
172 views
Too many pages causes Wordpress admin to be unusable
We have a Wordpress website that now has around 9k pages in it after an import of many location targeted pages. The frontend runs perfectly fine and there is no performance damage (after I replaced ...
0
votes
1answer
174 views
Site not responding error - taking long to load
I have a wordpress website which gets around 20K visits a days and with around 7pages/visit and 62 hits per visit.
My server is :
8 processors --> Intel(R) Xeon(R) CPU E5405 @ 2.00GHz
8 GB ...
0
votes
1answer
557 views
How to use “TRUNCATE TABLE” MySQL statement?
I have tried dbDelta and $wpdb->query, they does not work. Does anyone has any ideas?
1
vote
1answer
195 views
How do I write this SQL statement for Posts written in last 24 hours?
Someone gave me this SQL code to count the number of posts (of post_type 'mixtapes') in the last 7 days. I tried to convert it to 'in the last 24 hours' as well, but it's giving the wrong number.
...
0
votes
2answers
55 views
Problem with admin login after deployment
I made a site for a friend and everything worked so far on my development box that we can start final deployment and testing so I decided to put it on the hosting.
So I done the standard procedure ...
1
vote
1answer
562 views
Accessing WordPress MySQL Database via Data Connection in Visual Studio 2010 using C#
So I've Googled and followed countless tutorials, read documentation on MySQL, Visual Studio, WordPress, and Plesk. I try to leave posting on this site as the final option and it seems it has come to ...
0
votes
1answer
166 views
wp_insert_post - duration
i try to import a custom DB to the WP DB with about 2000 rows (custom post type).
the problem is that the insert by wp_insert_post takes about a second per insert.
Is this normal ? Is there a ...
1
vote
2answers
3k views
Get Featured Image via direct sql query
I know you can use the wordpress methods for getting a featured image, however with this particular project I need to get the featured image via mysql query. Can anyone point me in the right ...
2
votes
2answers
266 views
sql query to put quotes around numbers in img tag
I have quite a few old posts that contain an img tag with height and width with no double quotes around the numbers. For example:
<img height=319 alt="" ...
-1
votes
4answers
1k 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 ...
1
vote
1answer
325 views
Paypal Post IPN handeling nightmare
I'm trying to integrate paypal standard with my Wordpress site and all was going well until I wanted to do one simple thing:
The user submits a paypal payment
Paypal posts the IPN to my server
Post ...
1
vote
2answers
735 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.
...
4
votes
2answers
182 views
Is it possible to define two databases for one installation?
Is it possible to define 2 database for one wp installation, I have searched but there are options for one database and 2 installations. I want this because, one of my clients site is hosted on ...
0
votes
1answer
445 views
mySQL query. ORDER BY meta_key
I'm fighting this quite long already and start to think I'm missing something big. CPT posts could have or not metadata ( _vip_post [0|1], _thumbnail_id [null|numeric] ).
If i query for ...
0
votes
1answer
182 views
Export posts with postmeta without ID?
I have some select posts on one database that I need to export and import into a different database.
Because both databases are operating independently, there is overlap with post IDs so I can't ...
0
votes
1answer
427 views
Export SQL query based on custom field?
I'm operating on two WordPress sites and I need to export posts only with a specific custom field from one site and import into the other. I can't do a generic dump of the database because some data ...
1
vote
1answer
266 views
Using GROUP CONCAT in my-sql query with wp_usermeta table
I have a query that is meant to return user details from Wordpress tables. It would be fine if I was just SELECTing column names that I want, but within Wordpress there is a usermeta table which has 2 ...
1
vote
2answers
283 views
wpdb Custom Meta Data with 2 conditions
This is one of those problems that I've spent way too much time on, and there is probably a VERY simple solution that I am missing. Any help would be greatly appreciated.
I am trying to populate a ...
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
4answers
259 views
Migration: Copying database content to a different server
I'm migrating our WordPress site from one server to another. I need some hint on how to deploy a database dump (which I have) from the original server to the new one. There is no phpmyadmin (at least ...
0
votes
1answer
403 views
Custom query with filters returns wrong number of found_posts [closed]
I have a custom query with a couple of filters, defined in functions.php:
function myJoin($join) {
global $wp_query, $wpdb;
$join = "
LEFT JOIN $wpdb->postmeta AS i ON (
...
0
votes
1answer
64 views
Sql edits overwritten when editing a page/post via the wp editor [closed]
When I move a site from staging to production, I run a little sql to replace urls within page content:
update wp_posts set post_content = replace(post_content, '#stagingaddress#', ...
1
vote
2answers
232 views
Mysql query LIKE not working
I'm using this code.
$blog_list = $wpdb->get_results( "SELECT " . $extra . "blog_id, last_updated FROM " . $wpdb->blogs. " WHERE public = '1' AND archived = '0' AND mature = '0' AND spam = '0' ...
0
votes
2answers
747 views
Cannot Upload Custom Header Image into Wordpress Dashboard
I'm having trouble uploading a custom image into Wordpress' dashboard. It says that it needs to be a custom 1000x288 image. When I upload it, I get the error of:
Warning: ...
0
votes
1answer
498 views
Importing Wordpress Posts With Custom Meta Data As CSV Files Through PHPMyAdmin
I have been importing data records as posts with custom meta data directly into Wordpress via the CSV Importer plugin. It works okay, however, there are some issues with it.
Issues:
1) It takes ...
0
votes
1answer
376 views
Cloning blog to localhost via WAMP
How do restore a Wordpress blog (actually, cloning would be the right word) from my server to localhost with WAMP?
I backed up my blog with BackUpWordPress and got a .zip file ...
0
votes
1answer
266 views
Within the database, where is the flag which says that a user has Super Admin rights?
I have an user in a Wordpress Multisite installation and have access to the Mysql database, I would like to give myself super-admin rights to access the wp-admin/network page. Where can I do it on ...