Php 并非所有字段都插入到MySQL表中

Php 并非所有字段都插入到MySQL表中,php,mysql,sql,web-services,soap,Php,Mysql,Sql,Web Services,Soap,我有一个简单的SOAPWeb服务,它必须获取3项并将它们插入表中。但只插入前两个字段。怎么了 这是服务器: <?php require_once '../scripts/database_connection.php'; require_once "lib/nusoap.php"; ini_set("soap.wsdl_cache_enabled", "1"); $server = new soap_server(); $server->configureWSDL("appstat

我有一个简单的SOAPWeb服务,它必须获取3项并将它们插入表中。但只插入前两个字段。怎么了

这是服务器:

<?php
require_once '../scripts/database_connection.php';
require_once "lib/nusoap.php";
ini_set("soap.wsdl_cache_enabled", "1");

$server = new soap_server();
$server->configureWSDL("appstatus", "urn:appstatus");

$server->register('getStatus',
    array("uid" => "xsd:decimal", "status" => "xsd:decimal", "comment" => "xsd:string"),
    array("return" => "xsd:string"),
    "urn:appstatus",
    "urn:appstatus#getStatus",
    "rpc",
    "encoded",
    "Get Status");
    function getStatus($uid,$status,$comment) {
       mysql_query('SET NAMES "utf8"');
       $query="INSERT INTO a_test (uid, approved, comment) VALUES ('{$uid}','{$status}','{$comment}')";
        mysql_query($query);
}

$server->service($HTTP_RAW_POST_DATA);
<?php 
require_once ('lib/nusoap.php');
ini_set("soap.wsdl_cache_enabled", "0"); 
//$result=$client->call('getStatus' array ('uid'=>3,'status'=>1));
$param = array( 'uid' => '33','status'=>'1','comment' => 'some comment');
$uid=$param['uid'];
$status=$param['status'];
$comment=$param['comment'];
$client = new nusoap_client('http://localhost/webservice/getstatus.php?wsdl');
$response = $client->call('getStatus',$param);
if($client->fault) 
{ 
echo "FAULT: <p>Code: (".$client->faultcode."</p>"; 
echo "String: ".$client->faultstring; 
} 
else 
{ 
echo 'OK';
} 
?>

如果SQL查询中有输入错误,则第三个参数不是变量:

   $query="INSERT INTO a_test (uid, approved, comment) VALUES    
   ('{$uid}','{$status}','comment')";
替换为:

   $query="INSERT INTO a_test (uid, approved, comment) VALUES 
   ('{$uid}','{$status}','{$comment}')";

对不起,伙计们,一切都很好!编码时要注意;)我重命名了该文件,但继续编辑其以前的版本。