1

私のphpは、値が渡されたときにnullを返します.chromeのプラグインPOSTMANでチェックしました...問題を特定できません:\これは私のコードです.Androidコードから値を送信してデータベースを更新しようとしています(どちらでも構いません):-

<?php


$response = array();

// check for required fields
if (isset($_POST['id']) && isset($_POST['company']) && isset($_POST['date']) && 
isset($_POST['time']) && isset($_POST['ten']) && isset($_POST['twelve']) &&    
isset($_POST['aggregate']) && isset($_POST['backlog']) && isset($_POST['pending']) &&        
isset($_POST['branch'])) {
$cid = $_POST['id'];
$company = $_POST['company'];
$date = $_POST['date'];
$time = $_POST['time'];
$ten = $_POST['ten'];
$twelve = $_POST['twelve'];
$aggregate = $_POST['aggregate'];
$backlog = $_POST['backlog'];
$pending = $_POST['pending'];
$branch = $_POST['branch'];

// include db connect class
require_once __DIR__ . '/db_connect.php';

// connecting to db
$db = new DB_CONNECT();

// mysql update row with matched pid
$result = mysql_query("UPDATE companies SET company = '$company', date = '$date', time  
= '$time' ten = '$ten', twelve = '$twelve',aggregate = '$aggregate', backlog = 
'$backlog', pending = '$pending', branch = '$branch'  WHERE id = $cid");

// check if row inserted or not
if ($result) {
// successfully updated
$response["success"] = 1;
$response["message"] = "Company successfully updated.";

// echoing JSON response
echo json_encode($response);
} else {

}
} else {
// required field is missing
$response["success"] = 0;
$response["message"] = "Required field(s) is missing";

// echoing JSON response
echo json_encode($response);
}
?>
4

1 に答える 1

3

コンマを逃した:

= '$time', ten = '$ten', twelve = '$twelve', aggregate = '$aggregate', backlog = 
     ____^_____
于 2013-08-16T20:11:41.950 に答える