doucong8553 2014-05-03 08:32
浏览 370
已采纳

我有一个phpmyadmin表中的记录列表,我想更改所有记录中一个字段的值

I have a phpmyadmin database, I have tables with records in them, if i select a bunch of records and then hit edit it give me a printout of all the records, but i want to change ONE field in one column for all the records checked without having to scroll and change EVERY record and then hit "go"

any idea how to do that

we are talking about thousands of records, I need to just change ONE field column from "-3000" to "0"

Tried getting help in #PHPMYADMIN in IRC but everyone was sleeping i think

  • 写回答

3条回答 默认 最新

  • duanpao9781 2014-05-03 08:43
    关注

    You don't have a phpMyAdmin database: you have a MySQL database and you use phpMyAdmin as an administrative interface.

    This distinction is important because with every relational database you can use SQL to insert/update records in your tables. That is exactly what phpMyAdmin does: under the hood it uses SQL to change the content of your tables.

    Using SQL is a trivial thing changing thousands of records with a single statement, for example if the table is called atable and the column is called acolumn, you could do an update like this:

    UPDATE `atable` SET `acolumn`=-3000 WHERE `acolumn`=0;
    

    phpMyAdmin allows you to execute SQL code directly, but since it looks like this is the first time you try this, I strongly advise to make a backup first.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(2条)

报告相同问题?

悬赏问题

  • ¥15 ikuai客户端多拨vpn,重启总是有个别重拨不上
  • ¥20 关于#anlogic#sdram#的问题,如何解决?(关键词-performance)
  • ¥15 相敏解调 matlab
  • ¥15 求lingo代码和思路
  • ¥15 公交车和无人机协同运输
  • ¥15 stm32代码移植没反应
  • ¥15 matlab基于pde算法图像修复,为什么只能对示例图像有效
  • ¥100 连续两帧图像高速减法
  • ¥15 如何绘制动力学系统的相图
  • ¥15 对接wps接口实现获取元数据