我怎样才能在下面的语句中添加多个_POST值。
$sql = "INSERT INTO emails (emailaddress) // starting action
VALUES ('".$_POST['email']."')"; // I would like to add more values to send here
答案 0 :(得分:1)
foreach($_POST as $emailaddress){
$sql = "INSERT INTO emails (emailaddress) VALUES (" . $emailaddress . ")";
// Execute query here.
}