vendredi 11 mars 2016

how to fetch object in laravel

        $sql = "select userId,UserName from User_Master(nolock) where UserName = '$username'"; //Need to change query for location. 
        $results = DB::select($sql);    
        $userId = $results[0]['userId'];

Im unable to print $userId in this way. What is the correct syntax in laravel



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire