prøv at echo din sql sætning ud, står der det du forvendter ??
kunne det tænkes day4 er tom (og der kræves en værdi fra db) eller forkert datatype ??
lav
$res = mysql_query('INSERT INTO registrations (name, birth, gender, mail, mobile, address, postal, city, country, packagedeal, day1, day2, day3, day4, community, food, hotel, room, roommate1, roommate2) VALUES ("'.$name.'","'.$birth.'","'.$gender.'","'.$mail.'","'.$mobile.'","'.$address.'","'.$postal.'","'.$city.'","'.$country.'","'.$packagedeal.'",'.$day1.','.$day2.','.$day3.','.$day4.',"'.$community.'","'.$food.'","'.$sjufhotel.'","'.$sjufroom.'","'.$roommate1.'","'.$roommate2.'")');
om til
$sql = 'INSERT INTO registrations (name, birth, gender, mail, mobile, address, postal, city, country, packagedeal, day1, day2, day3, day4, community, food, hotel, room, roommate1, roommate2) VALUES ("'.$name.'","'.$birth.'","'.$gender.'","'.$mail.'","'.$mobile.'","'.$address.'","'.$postal.'","'.$city.'","'.$country.'","'.$packagedeal.'",'.$day1.','.$day2.','.$day3.','.$day4.',"'.$community.'","'.$food.'","'.$sjufhotel.'","'.$sjufroom.'","'.$roommate1.'","'.$roommate2.'")';
echo $sql; // ser denne sætning rigtig ud ??
$res = mysql_query($sql, $conn);
echo $res; // for du en recurse ??
hvorfor bruger du mysql_ og ikke mysqli_ ?? mysql_ API er på vej ud, kom så over på mysqli
http://dk.php.net/manual/en/mysqlinfo.api.choosing.php
Indlæg senest redigeret d. 31.08.2012 13:03 af Bruger #16075