Hi Dave,
I think your problem is that you're trying to call one of
your columns MD5(passwd) and my guess would be that you should do:

INSERT INTO forum_members( passwd, dateRegistered, realName,
 ID_MEMBER, memberName, emailAddress, active, keitai, number, admin,
 cardpic, cardbio, hofpic, hofbio, nickname, contactMe, showMe,
websiteUrl ) VALUES (MD5('temp'), UNIX_TIMESTAMP( joindate ) , CONCAT_WS( ' ', firstname, lastname ) , id, username, email, active, keitai, number,
 admin, cardpic, cardbio, hofpic, hofbio, nickname, contactMe, showMe,
 website)FROM members

/Johan

Dave wrote:

After reading through the MySQL manuals, as suggested here, I attempted to construct the following statement to copy data from the table "members" to the table "forum_members":

INSERT INTO forum_members( MD5(passwd) , dateRegistered, realName, ID_MEMBER, memberName, emailAddress, active, keitai, number, admin, cardpic, cardbio, hofpic, hofbio, nickname, contactMe, showMe, websiteUrl ) VALUES ('temp', UNIX_TIMESTAMP( joindate ) , CONCAT_WS( ' ', firstname, lastname ) , id, username, email, active, keitai, number, admin, cardpic, cardbio, hofpic, hofbio, nickname, contactMe, showMe, website)FROM members

However, I got the following error:

#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'MD5( passwd ) , dateRegistered, realName, ID_MEMBER, memberName,

It seems that MySQL does not like me putting in syntax to modify the fields within my INSERT command. Specifically, it objected to having MD5(), UNIX_TIMESTAMP(), and CONCAT_WS(). At least this is what is indicated to me within the phpMyAdmin interface, which highlights the erroneous sections of the statement in red.

Am I using the wrong statement? How do I take a value from one field, such as the date, and make it into a different format for inserting into another field if the INSERT command won't accept those modifications?

Dave



-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to