我有ps_orders
(total_paid) 和 (current_state)的表
如果当前状态为“3”,则写入$total_paid
如果不是“3”,则写入“0”
我提取了$total_paid
值,但我无法声明$current_state
变量
$query_cod = "SELECT total_paid FROM ps_orders WHERE current_state = 3":
$result_cod = mysql_query($query_cod);
while ($row_cod = mysql_fetch_array($result_cod))
$total_paid = $row_cod['total_paid'];
if ($current_state == 3) {
fwrite($file, "total_paid"); //38
}
elseif ($current_state == 2) {
fwrite($file, "|"); //38
}