I try to get name and adress and other data from database which the name and adress atributes are in text format, while the other atributes are in varchar format. I don't understand why some of those name and adress can not be caught while they are there in the db. From about 5000 records there are about 300 records which the name and adress can not be caught in my program. What I got after research is several of the names and addresses started with white space. So after I removed those white spaces, it works just fine. But for the others I just don't understand. They seem just normal text. Here the codes:
$hasil_query1= json_encode($data->getData($query));
$obj1 = json_decode($hasil_query1,true);
$name=$obj1[0]['name'];
$address=$obj1[0]['address'];
When I print $name or $adress, some of them don't appear (not caught). But when I use this code, instead of the above, it works just fine
$result = mssql_query($query);
while($row = mssql_fetch_array($result))
{
$name=$row['name'];
$address=$row['address'];
}
Please help me understand this because I just can not see it untill now.
Thanks for your advance.