OSEC

Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com
Importing - Adding Fields Into MySql From A List

From: revDAVE (Coolhosting4days.com)
Date: Mon Apr 14 2008 - 10:24:43 CDT


Newbie question!

I have a list of field names from another database (not mysql) - like:

name
phone1
phone2
street
city
state
zip
info
etc.... (a bunch more fields)

Q: Is there a way I can add these to an existing empty/blank table?

Maybe I can use:

- phpMyAdmin ?
- sql commands with php - loop thru a list of these names?
- import field names from CSV?
- some other method?

I tried a test with php and got NO errors - but no result either ( looked
with phpMyAdmin after - the table didn't add or drop the fields... Nothing
changed)

<?php
  
  $sql = 'ALTER TABLE `ztest` ADD `myfield2` VARCHAR(10) NOT NULL;';
  $sql = 'ALTER TABLE `ztest` DROP `myfield1`;';
  
 ?>

I have phpMyAdmin and If there's a way add tables w / php - maybe that would
work also....

If I can just get all the field names in the table as text fields - that
would be ok for now - then I can individually change the field type by hand
w phpMyAdmin...

--
Thanks - RevDave
Cool hosting4days . com
[db-lists]

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql