Adding new row to wp_post table

First, I assume you’re referring to columns, not rows. To answer your question, no, the upgrade process will not remove the extra columns from the posts table. That said, WordPress has the wp_postmeta table that should be used to store extra data about posts rather than adding columns to the posts table. I would suggest … Read more

WordPress doesn’t show all posts in database

Are you sure those aren’t pages, drafts, trashed, revisions or attachments? To make sure that those aren’t such, run the following in phpMyAdmin (Query tab – field “SQL query on database [database name]:”) Adminer In the terminal … and see how many results you get: select * from wp_posts where post_status=”publish”

Export all content from wordpress

WordPress already has this available under Tools > Export. You can export all of your posts, comments, authors, etc. into an XML file which you can them Import into a new (or not new) installation. I believe this has been part of the core since WordPress 2.1.

$wpdb get_var issue

I’ll guess that $wpdb->specials isn’t giving you what you expect. custom tables have to referenced like $wpdb->prefix . ‘specials’

Join new table with SQL query

Always escape/prepare your data Don’t leave it open to injections: global $wpdb; $all_posts = $wpdb->get_results( $wpdb->prepare( ” SELECT %s.* FROM %s LEFT JOIN %s ON(%s = %s) WHERE %s=”soundcloud” AND %s=”%s” ” ,$wpdb->posts ,$wpdb->posts ,”{$wpdb->prefix}soundcloud” ,$wpdb->posts.ID ,”{$wpdb->prefix}soundcloud.idpost” ,$wpdb->posts.post_type ,$wpdb->posts.post_name ,$name ), OBJECT ); echo ‘<pre>’.var_export( $all_posts, true ).'</pre>’; Use the prefix $wpdb; offers the $wpdb->prefix, … Read more

How do I copy a wordpress database?

The same WordPress Codex has a page for backing up your database with phpmyadmin; see http://codex.wordpress.org/Backing_Up_Your_Database You must export and import the database itself – and not do a posts export from the dashboard – to retain all settings, image URLs, etc. Either use phpmyadmin in your host control panel, or you can use it … Read more