您能否帮助我将此Coldfusion语句转换为PHP以更新MySQL?将ColdFusion查询转换为PHP
<cfquery name="getrecords">
select email,name,id,status from table1
where status = 0
</cfquery>
<cfloop query="getrecords">
<p>#getrecords.name#</p>
<p>#getrecords.name#</p>
<cfquery name="update">
update table1 set status =1 where status = #getrecords.status#
</cfquery>
</cfloop>
@Matt - 它不是过时的。去年有两个新的主要发布。一个由Adobe和一个由Railo提供。 – 2013-03-12 15:32:56
@MattBusche够公平的。我想我暴露了我对那个的无知:-) – Matt 2013-03-12 17:14:31
在我看来,你正在循环状态= 0的记录集,并设置状态= 1的每个记录...你总是可以运行一个查询,将显示状态为0的记录,然后运行状态为0的SINGLE更新语句。 #getrecords.status#在您的代码中始终为0 – user1137313 2016-08-22 07:00:19