これはよくある問題のように感じますが、Googleにとっては難しい問題です。
INSERT
コードのコメントで説明されているように、値の挿入は以前は問題ではありませんでしたが、その下にクエリを追加すると機能しなくなりました。
$user = $_POST['name'];
$night = $_POST['club'];
$query = mysql_query("SELECT day FROM nights WHERE name = '$night'");
$email = $_POST['email'];
while ($row = mysql_fetch_assoc($query)) {
$date = getFullDateString($row['day']);
$date2 = getDateString($row['day']);
}
// this one previously worked but now enters into the database with $user as "Array"
mysql_query("INSERT INTO guestlists (guest, night, date) VALUES('$user', '$night', '$date') ") or die(mysql_error());
$guest1 = $_POST['name1'];
$guest2 = $_POST['name2'];
// these were added later and work fine but seem to have had an effect on the query above
mysql_query("INSERT INTO guestlists (guest, night, date) VALUES('$guest1', '$night', '$date') ") or die(mysql_error());
mysql_query("INSERT INTO guestlists (guest, night, date) VALUES('$guest2', '$night', '$date') ") or die(mysql_error());
foreach ($_POST as $key){
if (is_array($key)){
foreach ($key as $key2 => $value){
mysql_query("INSERT INTO guestlists (guest, night, date) VALUES('$value', '$night', '$date') ") or die(mysql_error());
}
}
}