i'm facing same problem while json_encode suggest me what to do
 

On Tuesday, April 22, 2014 at 7:23:34 PM UTC+5:30, jaya raj wrote:
>
> hi,
>     
>     I can't access data of oreintdb record in ajax
>
>    the below code i used
>
> *  server side code*
>  
>  try {
> $this->odb = new OrientDB('localhost',2424);
> $connect = $this->odb->connect('gms', 'gms123');
>     $clusters = $this->odb->DBOpen('gms', 'gms', 'gms123');
>     $records = $this->odb->query("select * from coupon_package where 
> is_deleted = 0");
>     echo (json_encode($records));
>    }catch (OrientDBException $e) {
>      die("internal");
>       }
>
> *response:*
>     
>    
> [{"type":"d","version":1,"data":{}},{"type":"d","version":1,"data":{}},{"type":"d","version":1,"data":{}},{"type":"d","version":4,"data":{}}]
>
>
> *javascript code:*
>
>     $http({
> url: baseurl + 'welcome/getPackages',
>     method: "GET",
>     datatype:"JSON",
>   }).success(function (pakagelist) { 
>  
>                                  alert(pakagelist[0].version);
>  alert(pakagelist[0].data.amount);
> });
>
>
>
> *the above java script code i can access version of the response json 
> array but i can`t access data values. pls help me *
>
>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"OrientDB" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to