Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/database/8.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 我想使用webservice将输入数据插入数据库_Php_Web Services_Apache Flex - Fatal编程技术网

Php 我想使用webservice将输入数据插入数据库

Php 我想使用webservice将输入数据插入数据库,php,web-services,apache-flex,Php,Web Services,Apache Flex,我参考以下链接 代码: $client = new nusoap_client("http://localhost/jenny_flowers/online-shopping/webservice/index.php?wsdl",array('trace' => 1)); $in_contact=array ('first_name'=>'sona','last_name' => 'sdsdsd','email' => 'ssdsd','phone_number' =&g

我参考以下链接

代码:

$client = new nusoap_client("http://localhost/jenny_flowers/online-shopping/webservice/index.php?wsdl",array('trace' => 1));
$in_contact=array ('first_name'=>'sona','last_name' => 'sdsdsd','email' => 'ssdsd','phone_number' => 'sdsd');
$result = $client->call('insertContact', $in_contact);
if ($result){ echo "OK";
} else { echo "Error";
}
但它显示了

第7266行C:\wamp\www\jenny\u flowers\online shopping\webservice\lib\nusoap.php中的数组到字符串转换


实际问题是什么?帮助。

首先要有连接文件

connect.php

<?php

$mysql_db_hostname = "localhost";

$mysql_db_user = "root";

$mysql_db_password = "";

$mysql_db_database = "your database";







$con = @mysqli_connect($mysql_db_hostname, $mysql_db_user, $mysql_db_password,

 $mysql_db_database);



if (!$con) {

 trigger_error('Could not connect to MySQL: ' . mysqli_connect_error());

}
?>

insert.php

<?php
include_once('connect.php');

error_reporting( error_reporting() & ~E_NOTICE ); 
  //$first_name= $_GET['first_name'];
  $last_name= $_GET['last_name'];
  $email= $_GET['email'];
  $phone_number= $_GET['phone_number'];
{


$insert="INSERT INTO //your_table_name(first_name,last_name,email,phone_number)values
                                                        ('$first_name','$last_name','$email','$phone_number')";

  $result = mysqli_query($con, $insert);
                if(!$result)
                {

                    print("invalid query");
                }
                else
                {


                    $output['success']=1;
                    $output['message']="Insert records successfully";
                    print(json_encode($output));

                }
            }
?>

该库于2010年发布,似乎对sql注入开放,我怀疑它能否与最新的PHP配合使用。