简体   繁体   English

将值插入php列中的所有行

[英]Inserting a value into all rows in the column in php

表

I wanted to overwrite all the values in the Project1 column with 0 . 我想用0覆盖Project1列中的所有值。 Is there a way to do this ? 有没有办法做到这一点 ? Like all the students in studentid will all have 0 values in Project1 . studentid所有学生一样,在Project1都将具有0值。

You have to use an update query . 您必须使用更新查询

For your example: 例如:

UPDATE `TABLE_NAME` SET `Project1` = 0

要做:

UPDATE table_name SET Project1=0

Just omit where clause in Mysql, run this 只是省略Mysql中的where子句,运行它

update `mytable` set
`Project1` = 0
;

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM