I’ve been trying to figure this out for a while now. So I’m trying to add a custom field call “counter” to every single post. I try simply inserting the field “counter” to the post table. Every time a user clicks a button on the post, it increments the counter So far so good. But […]
When running the following code : $voucher = ‘MK0186′; $is_in_database = $wpdb->get_results( “SELECT * FROM my_codes_table WHERE code =” . $voucher ); I get : WordPress database error: [Unknown column ‘MK0186’ in ‘where clause’]. I don’t understand why.
I have a blog made with WordPress. If I click “Re-install” button present in WordPress updates page, will all the database be dropped and created again? Will my posts be deleted?
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 […]
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 […]
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 […]
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 […]
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?
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. […]
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@example.com”, “Database Error”, “There is […]