MySQL General List,
Server specifications:
MySQL 4.1.3-beta, phpMyAdmin 2.5.7-pl1, PHP 4.3.8
My specifications:
MySQL beginner, PHP intermediate, HTML and CSS advanced.
The situation:
I have recently installed a forum ( http://www.simplemachines.org/ )
on my web site. I already have about 150 users on my site, and I want to
transplant their information from their current table into the members
table used by the forum.
With many of the necessary fields, this means I have to take the
format of the current data and put it into a the new field with a
different format.
The Questions:
In the following 5 cases, will it be safe to copy data directly, or
will there be data loss or scrambling:
1. In the first case, the id number for the original table is an
INT, with a length of 11. In the target table, it's a MEDIUMINT with a
length of 8. Since I only have 150 members starting at an id of 1, I'm
assuming I can just copy the numbers without fear of truncation
2. The username in the source table is a VARCHAR with a length of
80, but the destination has a length of 16. What will happen to the data
in the destination table if it's longer than 16? Will it be truncated or
rejected?
3. The third case I'm a little confused about. In the source table,
I have a field for recording the date that the member joined. This is
stored in DATE format. The destination table uses a simple INT with a
length of 10. I this is a Unix time stamp format, because according to
the forum web site, you can access it from PHP using the time()
function. So would the command be something like:
COPY DATE(members.joindate) TO
UNIX_TIMESTAMP(forum_members.dateRegistered)
...?
4. For storing email addresses, the source table uses a VARCHAR
field with a length of 100. In the destination it's a TINYTEXT. If I
understand correctly, TINYTEXT should hold 256 characters, so there
should be enough room.
5. The last case I need to combine two fields into one. The source
table uses seperate fields for first name and last name, and each is a
VARCHAR with a length of 100. In the destination table, first and last
names are stored in the same field, with a TINYTEXT format.
However, despite the fact that I've looked up "combine fields" and
"concatenate fields" on Google, I can't find instructions on how to do
that in reference to merging two fields into one, or copying from one
field to another. All the references I found are for querying the
database, combining data at the point of user input. How do I combine
two fields from one table, and put them into another?
Any assistance is much appreciated. Thank you.
Dave
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]