|
|
||||||
|
||||||
| Index Link To US Private Messages Archive FAQ RSS | ||||||
| Database Discussion Forum This is the place to find help resolving those nagging questions you have about implementing and using all kinds of databases. Need help writing a query? Need an opinion on Oracle? Post here! |
Share Thread: & Tags
|
||||
|
![]() |
|
|
LinkBack | Thread Tools | Display Modes |
|
||||
|
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 ... |
|
||||
|
Quote:
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__.")");
?>
Last edited by edhan; 07-20-2009 at 11:18 AM. |
|
||||
|
I am not familiar with wordpress and am not sure if it is covered in your code somewhere else... but where is the $sql variable actually being sent to MySQL ?
maybe it's not the $sql but the call to the db thats failing? |
|
||||
|
Another question INT (4) or INT(4) ?
|
|
||||
|
Yep, it did strike me that the $database_name and $db_wp_connection variables weren't necessarily set with anything useful. I'm glad you got this one solved.
__________________
Buy a Smart Strip. Save time, energy and money! |
![]() |
|
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Wrong Keyword, Wrong Site leading to Wrong Traffic: Please Advice | adeelkhero | Google Discussion Forum | 19 | 07-14-2008 10:08 PM |
| Auto Run Command Question | sduquette | IT Discussion Forum | 1 | 04-15-2005 02:29 PM |
| link: command paranoia | magnolia1 | Google Discussion Forum | 3 | 12-14-2004 08:20 AM |
| Using Fdisk command | cecilia78 | IT Discussion Forum | 5 | 12-08-2004 11:41 PM |
| AltaVista's link: command | Will.Spencer | Search Engine Optimization Forum | 1 | 07-03-2004 02:29 AM |
|
WebProWorld |
Advertise |
Contact Us |
About |
Forum Rules |
MVP's |
Archive |
Newsletter Archive |
Top |
WebProNews
WebProWorld is an iEntry, Inc. ® site - © 2009 All Rights Reserved Privacy Policy and Legal iEntry, Inc. 2549 Richmond Rd. Lexington KY, 40509 |