1
vote
1answer
21 views

I want to select the from values from database in WordPress? [closed]

Here is my code: $sql = 'SELECT * FROM ' . $wpdb->base_prefix . 'item WHERE uname = "'. $_POST['login_name'] . '" '; $result = $wpdb->get_results($sql) or die(mysql_error()); foreach($result as ...
1
vote
1answer
22 views

$wpdb->wp_users returning empty value for

I have a code Example: function custom_func(){ global $wpdb; $wpdb->flush(); //tried with and without this line $getTest = 'SELECT * FROM $wpdb->wp_users LIMIT 1'; ...
0
votes
2answers
73 views

Different database query in function.php using mysqli

I am trying to connect to a database in the function.php using mysqli. The code seems to run fine when it is not on a separate php file not on wordpress. But when I run it on wordpress I get "Connect ...
0
votes
0answers
19 views

Best way to execute custom page-specific mysql queries

I would like to query a secondary mysql database (not the Wordpress mysql database) with page-specific queries. I've seen many answers / tutorials on setting up a secondary mysql database, like: ...
0
votes
4answers
93 views

Strange wordpress slowness

I read a lot about my problem. I have 4 years old Wordpress (with newest 3.8.1 Wordpress) site. And last months it become really slow. It takes about 3-5seconds to render page. In administration area ...
0
votes
0answers
31 views

Using the same shortcode to show any table from the database

I have a little question for you. I want to create a shortcode that makes a table with data that I have stored in a database. But i want to send the shortcode an attribute, to specify which table ...
0
votes
2answers
86 views

How to return number of found rows from SELECT query

I wrote a function which is supposed to return the number of rows found in a SELECT query but it always either seems to return 0 or an array. I have been messing around with this for about an hour now ...
0
votes
1answer
58 views

Add row to custom database Table and delete all rows older than 1 day

I'm editing a view counter plugin so that it logs the IP of every user that viewed a post. This is to prevent them from refreshing the page and thus creating artificial views. The part I'm having ...
0
votes
1answer
27 views

Splitting One Big WordPress Site into Multiple Small Sites

I have a very big WordPress site and I am facing speed issue and server resources issues. Specially numbers of MySQL records are so high. So, I want to split the big WordPress site into multiple small ...
1
vote
1answer
132 views

Successful or Error Message after running mysql code in functions.php

Just for this article, suppose there is a code that I want to run on my WordPress' functions.php file. It's a code to delete mysql table on my database. For example, here's the code: $wpdb->query( ...
0
votes
0answers
47 views

Unable to install WordPress on Plesk 11 Windows based machine

I am trying to install WordPress on a Windows server. The install was not able to create wp-config.php itself, so I created it and put in the database values. Now I get errors like this table doesn't ...
0
votes
1answer
199 views

How to display Shop Products in a Table Format with Column Headings as Custom Attributes in WooCommerce WordPress

I have already entered my products along with their custom attributes into my WooCommerce system and am looking to customize the look and layout of the Shop page to display products in a tabular ...
0
votes
0answers
41 views

Self-added mysql column as custom fields value

I am trying to add a value from a column that I've added myself to the wp_posts table as a custom field. So right now there is a column called 'shares' which holds an int value and I want that int ...
0
votes
1answer
253 views

use wordpress to create user on external database

let me try to explian what i wanna achieve, I have wordpress site and a project management system from codecanyon here is the link. http://codecanyon.net/item/freelance-manager/1225423 i have ...
1
vote
0answers
53 views

How to track a users progress through pages by inserting data into Wordpress Database?

My website users can learn British Sign Language through Video Tuts, Quizzes and games etc. I would like to track the users progress through the pages of the course and add that data to a Wordpress ...
1
vote
1answer
39 views

Wordpress not reflecting changed of the database

my problems started when I moved my website to another folder (from /dev/ to /). I have gone through the whole database in order to change all the hardcoded /dev/ into / but I still notice that ...
0
votes
2answers
38 views

Let users register weight each day and save it in DB

I need a way that lets my users register they're weight (kg) and maybe % of bodyfat and save that information on each user in the DB. Then i need a way to output that number again on the logged in ...
0
votes
2answers
207 views

Large Woocommerce Site (83,000 items), What Can I Do?

So I have a really large woocommerce site (partsboss.co) that has around 83,000 items. It's on VPS hosting with digitalocean, and things were running super fast until around 50,000 items. Now the ...
0
votes
0answers
8 views

External app Login using Wordpress login credentials [duplicate]

I am building a php application for which user needs to login first and those login credentials will be same as wordpress login credentials I am trying to connect the application with wordpress ...
0
votes
0answers
148 views

Custom Post Type or Custom Tables?

I am trying to build an application that takes 2 pieces of input from a user and saves it to the database. This is how users enter these two pieces of input; this form will be displayed using ...
0
votes
0answers
199 views

Insert & Upload image into data base in wordpress without using media library & plugin?

Here i am trying to insert image into WordPress database with custom code but i am not able to insert and uplode i am very new to wordpress any body have any idea how to do it?Bellow is my code with ...
0
votes
1answer
83 views

MySql Query for Wordpress

I need to count the number of value 1 from wp_ul_locked on wp_usermeta i try this code $wpdb->get_var("SELECT COUNT(*) WHERE 'meta_key' LIKE 'wp_ul_locked'"); or $wpdb->get_var("SELECT ...
0
votes
0answers
34 views

Unable to access MySQL in Powweb

I wanted to retrieve my data in powweb's mysql but I get an error: Warning: mysql_connect() [function.mysql-connect]: Access denied for user 'snursing'@'walcustweb1601.int.bizland.net' (using ...
1
vote
0answers
275 views

$wpdb->insert() does not Insert record in a table

I'm trying to understand and get hold of the $wpdb global object but can't seem to make it work. Basically, I'm trying to insert a single record into a custom table in wordpress DB. Instead of ...
0
votes
2answers
39 views

Mixing variables into an array when inserting values

I have a function that inserts a load of values into a database. Not a problem but I have a condition that changes the mysql statement. The problem is is the way wordpress constructs the statement, ...
-1
votes
1answer
80 views

Location of core code for database connection and get_header

I understand WP well enough to create a custom theme at a basic level, but have no experience with the core code. I've also just finished a book on basic php and mysql coding. I'd like to look 'under ...
0
votes
0answers
47 views

how to prevent words inside image tags from being update in a sql query via php

I need to update certain words inside wp_posts table (1032 posts in a specific time range) but I would like to exclude some words when they are inside tags like so: <img ...
0
votes
1answer
224 views

wpdb prepare insert table doesn't work

I followed the introduction to use prepare to insert some data to the table. The code is like this: $wpdb->query( $wpdb->prepare( "INSERT INTO ...
0
votes
1answer
43 views

select a single val though a table in wordpress

The table is like this: category_id category_name category_parent_name I would like to get category_id by using category_name. I searched online, and the code is like below: $ad_cat is the ...
0
votes
1answer
57 views

MySQL database migration to WordPress

I have a MySQL database established for a web application I have been working on in a non WordPress database. This database has many tables with pre-populated rows for foreign keys etc. which took a ...
0
votes
1answer
55 views

Should I use Wordpress to skin a database website?

I am going to start programming a website which allows users to post adverts for aircraft for sale. (Think autotrader for planes). It will be free to use. There are a few websites that do this already ...
0
votes
1answer
99 views

php include not working in custom page

The Problem I have a db.php file which contains mysql login details. I want it in a separate file like this so it can be linked in several different pages for easier tracing later. This all works ...
0
votes
1answer
87 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
2answers
101 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
0answers
66 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
1answer
149 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
236 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
1answer
115 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 ...
-3
votes
2answers
420 views

Preventing duplicate entries in mySQL database with PHP

I have a contact form (Contact Form 7) that submits all fields into a mySQL database (via the Contact Form 7 to Database Plugin), everything is working fine with that. I want it to however, throw the ...
0
votes
2answers
133 views

Make a database query using WordPress

I am working on a Wordpress theme that has a homepage slider. I have a table in Wordpress database that stores post view counts and I would like to make my slider show the top viewed posts. This is ...
4
votes
1answer
167 views

Custom query to get post names beginning with a digit

I'm implementing an A-Z index for a custom post type. I've got my links printing out the page and the query working for the letters. However, the numbers are tripping me up because I don't want them ...
5
votes
3answers
2k views

is it possible to run some php code within a wordpress page?

I'd like to access a DB table and render it in some data grid format using php on a dedicated wordpress page, accessible to members of a certain group. Is this at all possible with wordpress or is ...
1
vote
2answers
133 views

How to simultaneously access the same MySQL database in the main column and sidebar of Wordpress?

I've wrote some basic custom PHP code for my Wordpress site. The code basically access a MySQL database (a different database from the wordpress database) and displays the information. In addition to ...
0
votes
1answer
101 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 ...
2
votes
1answer
1k 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 ...
0
votes
1answer
91 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 ...
1
vote
3answers
305 views

Delete post revisions on post publish

Is it possible to delete post/page revisions from the database when a post/page is published? 11/05/12 Answer: See the plugin below by bueltge I want to do this on a site with 5,000 posts and ...
1
vote
2answers
362 views

How to create and work with custom data / tables (i.e., for arbitrary data)?

Getting started on Wordpress just today. I noticed that Wordpress created tables in a mySql database (with name *.wrdp1) when I first set it up. These tables cover comments, posts, users, and some ...
1
vote
1answer
544 views

mysql query from wordpress page using custom table

I want to a mysql query that matches a page title. Not sure of a better way to accomplish this task, but I am stuck. This is my basic test code. <?php $page_title = wp_title(''); echo ...
0
votes
1answer
310 views

populate select options from extra mysql table data

hi guys i am trying to populate a select element with options from the data in one of my sql tables heres what i have so far: <? $SQL = "SELECT * FROM pt_country ORDER BY name"; $rs = ...