Quote:
Originally Posted by kgun
I am a little away from SQL now, but
have you tried the command from SQL command level?
Just wondering: Should it be
... ADD COLUMN ...
|
post_category is the column I want to add after the post_title. I have done it in phpMyAdmin and it works. But I have alot of wordpress blogs to update so thinking of just writing a small php file where it will be easier to update them. I still can't figure out where I went wrong. arrrgghhhh ...
SOLVED:
Change the command to be like this:
Code:
<?
require('wp-config.php');
$db_wp_connection = mysql_pconnect(DB_HOST, DB_USER, DB_PASSWORD) or trigger_error(mysql_error(),E_USER_ERROR);
$database_name=DB_NAME;
mysql_select_db($database_name, $db_wp_connection);
$p_sql="select * from wp.posts";
$rs_table = mysql_query($p_sql, $db_wp_connection);
$sq = "ALTER TABLE wp_posts ADD post_category INT (4) NOT NULL AFTER post_title";
mysql_query($sq) or die(mysql_error()." (script line: ".__LINE__.")");
?>