未分類

PHP PDO連接Mysql

getMessage();
}

// 查詢會員
$result = $pdo->query("select * from tb_member where m_id = '$w_name'");
//更新
$pdo->exec("UPDATE tb_member SET m_cash = m_cash + $w_money WHERE m_id = '$w_name'");
//寫入記錄
$pdo->exec("INSERT INTO tb_bouns ( w_number, w_bname, w_name, w_money, w_type, w_time, w_ip ) VALUES ('$w_number','$w_name','$w_name','$w_money','$w_type','$w_date','$w_ip')");

foreach ($result as $row) {
echo $row[w_name]
}
?>