mysql データベースは NULL 値を追加できません
データは検証されましたが、NULL 値をデータに追加できません。エラーは次のとおりです:
Column 'loumiandijia' cannot be null
<?php<br />require ('inc/config.php');<br />$page_title = '住宅データ追加- feige Data Center';<br />include ('inc/ header.php');<br />require (MYSQL);<br />if ($_SERVER['REQUEST_METHOD'] == 'POST') { <br /> $トリム = array_map('trim', $_POST);<br /> $errors = array();<br /> if (!empty($trimmed['tudi_id'])) {<br /> $tudi_id = mysqli_real_escape_string ($conn , $trimmed['tudi_id']);<br /> } else {<br /> $errors[] = 'プロット番号を空にすることはできません';<br /> } <br /> if (isset($trimmed['city'] ) && filter_var($trimmed['city'], FILTER_VALIDATE_INT, array('city' => 1)) ) {<br /> $city = mysqli_real_escape_string ($conn, $trimmed['city']);;<br /> } else {<br /> $errors[] = 'リージョンを選択してください';<br /> }<br /> $weizhi = (!empty($trimmed['weizhi'])) mysqli_real_escape_string ($conn, $trimmed ['weizhi']) : NULL;<br /> $ yongtu = (!empty($trimmed['yongtu'])) mysqli_real_escape_string ($conn, $trimmed['yongtu']) : NULL;<br /> $rongjilv = (!empty($trimmed['rongjilv']) ) ? mysqli_real_escape_string ($conn, $trimmed['rongjilv']) : NULL;<br /> $midu = (!empty($trimmed['midu'])) ? mysqli_real_escape_string ($conn, $trimmed['midu'] ) : NULL; $lvdi = (!empty($trimmed['lvdi'])) ? mysqli_real_escape_string ($conn, $trimmed['lvdi']) : NULL; <br /> if(empty($trimmed[ 'fabu_time'])) {<br /> $errors[] = 'リリース日を空にすることはできません';<br /> } else {<br /> $fabu_time = mysqli_real_escape_string ( $conn, $trimmed['fabu_time']);<br /> }<br /> if(empty($trimmed['chengjiao_time'])) {<br /> $errors[] = '取引日を空にすることはできません'; <br /> } else {<br /> $chengjiao_time = mysqli_real_escape_string ( $conn, $trimmed['chengjiao_time']);<br /> }<br /> if(empty($trimmed['jiezhi_time'])) {<br /> $errors[] = 'マージン期限を空にすることはできません'; <br /> } else {<br /> $jiezhi_time = mysqli_real_escape_string ($conn, $trimmed['jiezhi_time']);<br /> } <br /> if (is_numeric( $trimmed['baozhengjin']) && ($trimmed[ 'baozhengjin'] > 0)) {<br> $baozhengjin = mysqli_real_escape_string ($conn, (float) $trimmed['baozhengjin']);<br> } else {<br> $errors[] = '正しい入札保証金 (10,000 元) を入力してください';<br> }<br> if (is_numeric($trimmed['mianji_m']) && ($trimmed['mianji_m'] ] > 0)) {<br> $mianji_m = mysqli_real_escape_string ($conn, (float) $trimmed['mianji_m']);<br> } else {<br> $errors[] = '正しいフロアを入力してくださいarea (acres)';<br> } <br> if (is_numeric($trimmed['mianji_p']) && ($trimmed['mianji_p'] > 0)) {<br> $mianji_p = mysqli_real_escape_string ($conn) , (float) $trimmed['mianji_p' ]);<br> } else {<br> $errors[] = '正しい床面積を入力してください';<br> }<br> if (is_numeric($trimmed[ 'guihua_p']) && ($rimmed['guihua_p'] > 0)) {<br> $guihua_p = mysqli_real_escape_string ($conn, (float) $trimmed['guihua_p']);<br> } else {<br> $errors[] = ' 正しい建築計画面積を入力してください';<br> }<br> if (is_numeric($trimmed['qipaijia']) && ($trimmed['qipaijia'] > 0)) {<br> $qipaijia = mysqli_real_escape_string ($conn, (float) $trimmed['qipaijia']);<br> } else {<br> $errors[] = '正しい開始価格 (10,000/エーカー) を入力してください';<br> } <br> $chengjiaodanjia = (!empty($trimmed['chengjiaodanjia'])) ? mysqli_real_escape_string ($conn, (float) $trimmed['chengjiaodanjia']) : NULL;<br> $chengjiaodanjia = (!empty($ trimmed['chengjiazongjia'])) ? mysqli_real_escape_string ($conn, (float) $trimmed['chengjiazongjia']) : NULL;<br> $loumiandijia = (!empty($trimmed['loumiandijia' ])) ? mysqli_real_escape_string ( $conn, (float) $trimmed['loumiandijia']) : NULL;<br>$yijialv = (!empty($trimmed['yijialv'])) ? mysqli_real_escape_string ($conn, $trimmed['yijialv']) : NULL;<br> $jingderen = (!empty($trimmed['jingderen'])) ? mysqli_real_escape_string ($conn, $trimmed['jingderen']) : NULL;<br> $churang_p = (!empty($trimmed['churang_p'])) ? mysqli_real_escape_string ($conn, (float) $trimmed['churang_p']) : NULL;<br> $dituweizhi = (!empty($trimmed['dituweizhi'])) ? mysqli_real_escape_string ($conn, $trimmed['dituweizhi']) : NULL;<br> $xuzhi = (!empty($trimmed['xuzhi'])) ? mysqli_real_escape_string ($conn, $trimmed['xuzhi']) : NULL;<br> if ( isset($trimmed['is_cheng']) && is_numeric($trimmed['is_cheng']) && ($trimmed['is_cheng'] ] >= 0) ) {<br> $is_cheng = mysqli_real_escape_string ($conn, $trimmed['is_cheng']);;<br> } else {<br> $errors[] = '请选择取引易かどうか' ;<br> } <br> <br> if (empty($errors)) {<br> $q = 'INSERT INTO f_tudi (tudi_id, city_id, weizhi, yongtu, rongjilv, midu, lvdi, fabu_time, chengjiao_time, jiezhi_time 、baozhengjin、mianji_m、mianji_p、guihua_p、qipaijia、chengjiaodanjia、chengjiazongjia、loumiandijia、yijialv、jingderen、churang_p、dituweizhi、xuzhi、is_cheng) VALUES (?, ?, ?, ?, ?, ? 、 ?、 ?、 ?、 ? , ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)';<div class="clear"></div>