从安卓应用程序插入SQL获取空白值


insert into sql from android app getting blank value

我正在使用php脚本从我的android应用程序中声明变量,该应用程序正在传递值。我已经仔细检查了代码,传递值似乎很好,但是在插入值时,我从 1 列(占用列)中得到了一个空白值。
插入.php


<?php
$con=mysql_connect('localhost','root','');
mysql_select_db("dbfema",$con);
$address=$_POST['address'];
$zipCode=$_POST['zipCode'];
$identifier=$_POST['identifier'];
$stories=$_POST['stories'];
$year=$_POST['year'];
$name=$_POST['name'];
$area=$_POST['area'];
$bName=$_POST['bName'];
$usage=$_POST['usage'];
$occupancy=$POST['occupancy'];
$person=$_POST['person'];
$soilType=$_POST['soilType'];
$falling=$_POST['falling'];
$bType=$_POST['bType'];
$basicScore=$_POST['basicScore'];
$midrise=$_POST['midrise'];
$highrise=$_POST['highrise'];
$virregularity=$_POST['virregularity'];
$pirregularity=$_POST['pirregularity'];
$precode=$_POST['precode'];
$pbenchmark=$_POST['pbenchmark'];
$soiltypec=$_POST['soiltypec'];
$soiltyped=$_POST['soiltyped'];
$soiltypee=$_POST['soiltypee'];
$finalscore=$_POST['finalscore'];
$lati=$_POST['lati'];
$longi=$_POST['longi'];
$comments=$_POST['comments'];
$eval=$_POST['eval'];
$base=$_REQUEST['image'];
$filename = $_REQUEST['filename'];
$binary=base64_decode($base);
header('Content-Type: bitmap; charset=utf-8');
$file = fopen('uploadedimages/'.$filename, 'wb');
fwrite($file, $binary);
fclose($file);
$base2=$_REQUEST['image2'];
$filename2 = $_REQUEST['filename2'];
$binary2=base64_decode($base2);
header('Content-Type: bitmap; charset=utf-8');
$file2 = fopen('uploadedimages/'.$filename2, 'wb');
fwrite($file2, $binary2);
fclose($file2);
mysql_query("INSERT INTO `screening`(`idLokasi`, `alamat`, `kodePos`,
 `otherId`, `stories`, `yearBuilt`, `screenerName`, `totalArea`, 
`buildingName`, `usage`, `foto1`, `foto2`, `totalPerson`, `soilType`, 
`fallingHazard`, `buildingType`, `basicScore`, `midRise`, `highRise`, 
`vIrregularity`, `pIrregularity`, `preCode`, `postBenchmark`, `soilTypeC`, 
`soilTypeD`, `soilTypeE`, `finalScore`, `latitude`, `longitude`, `comments`, 
`eval`, `occupancy`)     
  values(NULL,'$address','$zipCode','$identifier','$stories','$year','$name',
'$area','$bName','$usage','$filename','$filename2','$person','$soilType',
'$falling','$bType','$basicScore','$midrise','$highrise','$virregularity',
'$pirregularity','$precode','$pbenchmark','$soiltypec','$soiltyped','$soiltypee'
,'$finalscore','$lati','$longi','$comments','$eval','$occupancy')");
?><br/>


的结构

CREATE TABLE IF NOT EXISTS  `screening` (
`idLokasi` INT( 11 ) NOT NULL ,
`alamat` VARCHAR( 100 ) COLLATE utf8mb4_unicode_ci DEFAULT NULL ,
`kodePos` INT( 11 ) DEFAULT NULL ,
`otherId` VARCHAR( 10 ) COLLATE utf8mb4_unicode_ci DEFAULT NULL ,
`stories` INT( 11 ) DEFAULT NULL ,
`yearBuilt` INT( 11 ) DEFAULT NULL ,
`screenerName` VARCHAR( 100 ) COLLATE utf8mb4_unicode_ci DEFAULT NULL ,
`tanggal` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ,
`totalArea` INT( 11 ) DEFAULT NULL ,
`buildingName` VARCHAR( 50 ) COLLATE utf8mb4_unicode_ci DEFAULT NULL ,
`usage` VARCHAR( 30 ) COLLATE utf8mb4_unicode_ci DEFAULT NULL ,
`foto1` VARCHAR( 50 ) COLLATE utf8mb4_unicode_ci DEFAULT NULL ,
`foto2` VARCHAR( 50 ) COLLATE utf8mb4_unicode_ci DEFAULT NULL ,
`occupancy` VARCHAR( 50 ) COLLATE utf8mb4_unicode_ci DEFAULT NULL ,
`totalPerson` VARCHAR( 10 ) COLLATE utf8mb4_unicode_ci DEFAULT NULL ,
 `soilType` VARCHAR( 15 ) COLLATE utf8mb4_unicode_ci DEFAULT NULL ,
`fallingHazard` VARCHAR( 25 ) COLLATE utf8mb4_unicode_ci DEFAULT NULL ,
`buildingType` VARCHAR( 5 ) COLLATE utf8mb4_unicode_ci DEFAULT NULL ,
`basicScore` FLOAT DEFAULT NULL ,
`midRise` FLOAT DEFAULT NULL ,
`highRise` FLOAT DEFAULT NULL ,
`vIrregularity` FLOAT DEFAULT NULL ,
`pIrregularity` FLOAT DEFAULT NULL ,
`preCode` FLOAT DEFAULT NULL ,
`postBenchmark` FLOAT DEFAULT NULL ,
`soilTypeC` FLOAT DEFAULT NULL ,
`soilTypeD` FLOAT DEFAULT NULL ,
`soilTypeE` FLOAT DEFAULT NULL ,
`finalScore` FLOAT DEFAULT NULL ,
`latitude` DECIMAL( 9, 6 ) DEFAULT NULL ,
`longitude` DECIMAL( 9, 6 ) DEFAULT NULL ,
`comments` VARCHAR( 300 ) COLLATE utf8mb4_unicode_ci DEFAULT NULL ,
`eval` VARCHAR( 3 ) COLLATE utf8mb4_unicode_ci DEFAULT NULL
) ENGINE = INNODB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_unicode_ci AUTO_INCREMENT =2;<br/>

我的代码有错误吗?请帮助我。

$occupancy=$POST['占用'];你在开机自检前忘记了"_",比如"_POST"

typos...