Articles of database

Import External XML

I don’t know where to start with this one. I would like to create custom post type which will list properties on clients website. I would like those properties being feed from another website/software. So other website/software will be sending XML file to my WordPress site and I would like to receive that file and […]

Locking one blog of many in a multi user/blog WordPress installation

I have a multi user /wordpress installation that is working fine. One of the blogs running on that multi user /wordpress installation will never be updated again but I want it there for historic reasons. Is it possible to make one blog read-only even though it is on a multi user /wordpress installation and sharing […]

Get a custom table to an array

How can I take my table I created like this: global $wpdb; //Get all the wordpress database stuff $table_prefix = $wpdb->base_prefix; //Get the global prefix for all sites (on a multisite installation) $table_name = $table_prefix.’wpaa’;//Add wpaa behind the prefix $sql = “CREATE TABLE IF NOT EXISTS `”.$table_name.”` (….) “; //Create table and its rows. (Rows […]

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 easiest way would to do a remote connection, but my host does not allow that. All I am trying to […]

How safe is it to delete old posts edits to save database space?

After this question: https://wordpress.stackexchange.com/a/93902/27148 There is an answer that suggests deleting past edits directly from database, which would be nice, because I could create queries to delete specific edits only. But, Is this safe? Why?

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 like to know how to use LIMIT 0,1000 to query only the last 1000 added posts to the database when using get_row() function. […]

How can I restrict php mail() to only send me one email after a db error

I’m in the process of customizing dp-error.php. I’m using the mail() function to alert me when there’s a database connection problem on my website. The trouble is, what if 1000 people visit my website when it’s down? Wouldn’t I get 1000 emails? Here’s the code I’m using to send email: mail(“email@email.com”, “Database Error”, “There is […]

Get value form wordpress database

I’m sorry if this ambiguous but I’ll try my best I have the following php code from a WordPress Plugin $url = ‘http://mydomain.com/’.$ListingID.’/’; I need to define a value for $ListingID The value will come from the wordpress database and is found in the table called wp_fsrep_listings the name of the column in the table […]

Specify strict 'order by' in WordPress query

I have a custom post type called Employees where an employee’s name is the post_title of each post. I am trying to figure out how I would sort the post_title column by last name. So for instance, if we have the following post entries: 1. Justin Bieber 2. Selena Gomez 3. Jessica Alba 4. Nicholas […]

Designing a custom post type with a minimum number of meta fields

I am new to PHP, mySQL and scripting in general. I’m trying to design a WP custom post type which would be like a point on a timeline or an item on a resume. I’m having trouble designing the structure of the data in a nice, neat way. Each post or ‘item’ can be either […]