Articles of database

restore a db after bad backup

i haven’t got any experience in wordpress so please sorry me if answers seems too trivial. one upon a time i had a blog. then the hosting service expired and i get a backup in a hurry way: the bad way. i copied all the root directory i dumped the mysql database now i’ve just […]

Detail explanation of wordpress database fields and metatag list

I am trying to understand the fields of various table and default list of metatags for the tables, currently being used in wordpress. Though google is showing up various results , but I need a detail one with list.

pull data from a remote wordpress database

I am trying to pull some data from a remote wordpress database. Here is the code I have: $server = “my server code”; $user = “my username”; $password = “my password”; $db = “mydb”; $con = mysql_connect($server,$user,$password); if (!$con) { die(“database connection error”); } else { mysql_select_db($db, $con); function dp_get_user_liked_posts($user_id, $fields = ”) { global […]

After moving my site from a dev subdomain, to root, all my custom meta data is gone

I just movde my site from a dev subdomain, to the root. I have extensive amounts of data saved in custom meta fields which I created with the WpAlchemy class. All of this data is not appearing in the site (back or front end), although it appears to be in the database. This happened right […]

Check if post id exist in table than only update instead of inserting new row

I am trying to add simple view counter for my advert and everything seems works fine with below code but only it is inserting each time new row on post “Update”. What I want if the post id is exists than it should not add or modify anything into that table just ignore so view […]

wordpress database restore – broken link

I’ve tried to play with db backup and restore but I am dealing with difficulties. This what I’ve done: I backed up database using cPanel option and got 8MB large SQL file. Afterwards I installed new WordPress in it’s own new home. I accessed database associated with new installation of WordPress through phpMyAdmin and dropped […]

Adding custom field and querying from post table

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 […]

PHP variable in WordPress database query

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.

Is database deleted on clicking “reinstall” button in WordPress updates?

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?

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 […]