PHP 中的 SQL 查询 [英] SQL query in PHP
本文介绍了PHP 中的 SQL 查询的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个表 (T1
),其中包含一些字段 F1,F2
(列),其中包含一些值.
I have a table (T1
) with some fields F1,F2
(Columns) with some values in it.
这里 F1
是主键,自动递增.
here F1
is the primary key and is auto incremented.
现在我需要从 F1
的每一行中获取值并将其分配给 F2
.
Now I need to fetch the values from each row of F1
and assign it to F2
.
像这样
F2 =$value . $value1
$value
是代码中预定义的常量值
$value
is a constant value predefined in the code
$value1
是从 F1 对应的行中取出的值.
$value1
is the value that is fetched from the corresponding row of F1.
你能帮我用 SQL 和 PHP 编写以下代码吗?
Can you help me in writing the code for the following with SQL and PHP.
推荐答案
update T1 set F2 = concat('$value', F1)
这篇关于PHP 中的 SQL 查询的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文