【问题标题】:Importing a specific column into phpmyadmin database将特定列导入 phpmyadmin 数据库
【发布时间】:2011-04-19 12:59:39
【问题描述】:

我收到了一份 Excel 文档,其中包含有关不同大使馆、他们的联系电话等的信息。这些信息中的大部分已经在数据库中,但我需要从该文件(电子邮件)中提取一列并将其插入到数据库中的特定列(电子邮件)。

这可能吗,还是只能在数据库中导入所需内容的精确副本?

感谢您的帮助

【问题讨论】:

  • 我认为您需要使用加载数据并将电子邮件导入空表。完成后,您可以使用更新查询与此表建立连接,以更新您的原始表。
  • 有可能,寻求更多帮助。请与您一起提供更多信息...

标签: php mysql phpmyadmin


【解决方案1】:
Export the table from phpmyadmin as CSV for excel - 
drag it into excel - 
add the desired column - 
Save - 
export the table again from phpmyadmin as .sql - 
copy the table creation(Not the data) - 
delete the table from phpmyadmin- 
Run the table creation query so you now have a blank table - 
Import the excel csv.

重要提示:备份您的数据库

【讨论】:

    【解决方案2】:

    您可能希望使用php-excel-reader 创建一个脚本,该脚本遍历文件中的每一行,并更新相应的数据库行。我认为您不能在 phpMyAdmin 中“有选择地”导入文件。

    【讨论】:

      猜你喜欢
      • 2015-12-31
      • 1970-01-01
      • 1970-01-01
      • 2017-07-24
      • 2017-03-18
      • 1970-01-01
      • 2012-09-08
      • 2016-07-16
      • 2014-08-05
      相关资源
      最近更新 更多