When I dump the variable it has a data:
var_dump($result);
object(stdClass)#2 (5) { ["user_id"]=> string(1) "1" ["username"]=> string(6) "user_name" ["email"]=> string(14) "[email protected]" ["password"]=> string(32) "password" ["test"]=> string(1) "1" }
But when I use foreach no value has return except if I just echo $data; but I want to be specific to the value I want to get.
foreach($result as $data){
echo $data->use_id;
echo $data->username;
}
Why there is no returned value?
echo $data->user_id
notecho $data->use_id;
– Tamil Selvan Mar 3 '14 at 15:15