Insert Xml Data From Address Bar

Hi I have some records as the below format , i want to insert value into database from address bar




127.0.0.1/BetaProject/index.php/Robot/Update?data=<?xml version="1.0" encoding="utf-8"?><DataManage><RobotTime>2012-03-01</RobotTime><RobotModel>Y123</RobotModel><RobotStation>Station1</RobotStation><RobotVer>1.0</RobotVer></DataManage>



This is my controller




class RobotController extends Controller{

    

    public function actionUpdate($data=''){

        $Robot = new robotAction();

        $xmlcode = simplexml_load_string(trim($data));

 

        $xmlresult = $xmlcode->xpath("//DataManage");

  

        

        $result=$Robot->Update($xmlresult);

        return $result;

       

    } 

}


?>



This is my model




<?php if (! defined ('YII_PATH')) exit ('No direct script access allowed');

define("MainDB","robotDB");


class robotAction{

    

        public function Update($xmlData){

            

        

            

            $mysql = new RobotMYSQL();

           

            $sqlstr="INSERT INTO ".MainDB.".robot(

                    RobotTime,

                    RobotModel,

                    RobotStation,

                    RobotVer) VALUES ($xmlData)";


        $result = $mysql->MyExcute(MainDB, $sqlstr);

        return  $result ;

             


        }

}

?>




But I get error of:




PHP notice


Array to string conversion 



Please advice :-[

I had google for convert xml to string and I had updated my model,




<?php if (! defined ('YII_PATH')) exit ('No direct script access allowed');

define("MainDB","robotDB");


class robotAction{

    

        public function Update($xmlData){

            

         $xml = json_decode(json_encode((array) simplexml_load_string($xmlData)), 1);

            

            $mysql = new RobotMYSQL();

           

            $sqlstr="INSERT INTO ".MainDB.".robot(

                    RobotTime,

                    RobotModel,

                    RobotStation,

                    RobotVer) VALUES (".$xml.")";


        $result = $mysql->MyExcute(MainDB, $sqlstr);

        return  $result ;

             


        }

}

?>




but I still get error:




PHP warning


simplexml_load_string() expects parameter 1 to be string, array given 



Please help :-[ :-[ :-[ :-[ :-[