I wonder if it's possible to send multiple variables at once to the server? For example:
$client->AddTheseValues($a, $b, $c);
The server/MySQL would then add th开发者_StackOverflowose values into the database:
public function AddTheseValues($a, $b, $c) {
$this->sql = "INSERT INTO `records` (`a`,`b`,`c`) VALUES
('{$a}','{$b}','{$c}');";
$result = mysql_query($this->sql);
}
The above procedure doesn't seem to work with me; I'm only able to send ONE variable at time. When I send more than one, the database won't get updated and weirdly I get no error messages.
You can pass an array.
$responses = array();
$responses[] = array("QuestionAnswerID" => someint, "QuestionID" => someint);
$responses[] = array("QuestionAnswerID" => someint, "QuestionID" => someint);
$response = array("Response" => $responses);
$soapData = array("Responses" => $response);
Source of the code above Passing a PHP array in a SOAP call
I hope this helps.
精彩评论