Articles of database

Duplicate domain database to local – How?

I’ve noticed that my process is rather slow and i’d like to speed it up. I want to be able to duplicate my database from my domain which is blueharlequin.com and work locally thus speeding up the process. The reason I want to do that is because our website has specific loops that I cannot […]

Is there a way to run upgrade.php for one blog?

I just ran the auto update to verion 3.9 today, but am having problems with the “Network Update”. I seem to have a firewall or network problem with this error : Your server may not be able to connect to sites running on it. Error message: couldn’t connect to host Anyways, is there a way […]

Cannot update custom database table row

I am trying to update a row in a custom database table by $wpdb->update();. In my opinion my code is right but for some reason my database row doesn’t update. Can anyone help me with this? I want to update a the status of a transaction in the table wp_mollie_transactions where the transaction_id is equal […]

Cannot unserialize WordPress serialized values in `wp_options` table?

I have nav_menu_options in my WordPress database as below. 284,’nav_menu_options’,’a:2:{i:0;b:0;s:8:\”auto_add\”;a:0:{}}’ I tried to deserialize this value but the result is empty string – I put a code snippet in <my theme>/function.php as below echo ‘TRY #1′.'<br>’; $v = ‘a:2:{i:0;b:0;s:8:\”auto_add\”;a:0:{}}’; $d = unserialize($v); print_r($d); echo ‘TRY #1 end’.'<br>’; echo ‘TRY #2′.'<br>’; $v =’a:5:{s:9:”engine_id”;a:1:{i:0;s:9:”300000225″;}s:15:”transmission_id”;a:1:{i:0;s:6:”257691″;}s:5:”plant”;a:1:{i:0;s:23:”Oshawa, Ontario, Canada”;}s:15:”Manufactured in”;a:1:{i:0;s:6:”CANADA”;}s:22:”Production […]

How to fetch Data in WordPress using MySQLi or $wpdb

I have custom table like this: useraw 1. id (Primary*) 2. user_ip 3. post_id 4. time I am inserting data in the table using $wpdb->insert($table_name , array(‘user_ip’ => $user_ip, ‘post_id’ => $postID, ‘time’ => $visittime),array(‘%s’,’%d’, ‘%d’) ); There are four rows I inserted using this code: id : 245 user_ip : 245.346.234.22 post_id : 24434 […]

database columns: post_title vs post_name

I changed post_title, post_contents, and post_name to allow for utf by changing collating sequence to: utf8_general_ci Then using add new post, I type for the title three Hebrew ALEFs. The post_title is in Hebrew in the database, but the post_name has this value: %d7%90%d7%90%d7%90 According to Charmap, ALEF has a hex value of 05D0. So […]

Bootstrapping WordPress MultiSite Outsite of WordPress – No $wpdb

I’m working on a plugin for a system to use WordPress as the authentication backend, so that I can use my existing WordPress users in another application. The plugin works great when running in single website mode: include /path/to/wordpress/wp-config.php global $wpdb; // SQL and code to select user and compare entered passwords I need this […]

How to find if a post with custom_field == X exists?

I need to find if a post with a custom field X equal to Y exists in a wordpress installation. Should I do it with a simple sql query or is there something build in that can help me achieve it?

Using two different DB users on one WP install

I’m curious as to whether the following is possible as there are concerns that the WP site in question may be hacked via the front end & through a plugin.. We want to have the front-end connect via a Read-Only DB user We want the admin area to have Read/Write access but have this URL […]

How to generate page content from database the right way?

I am creating many pages and store them into the database. I am first styling them and than storing them. The idea is to use page.php to check the page id and display the needed post. This is all good, but I have many pages in the website. WHich means I have to perform the […]