您能否幫助我將此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