0
I’m trying to do this query but the $test variable enters empty in the query but when I print it, I see it exists
namespace App\Http\Controllers;
use Illuminate\Http\Request;
Use App\User;
class BinarioController extends Controller
{
public function listanaoposicionados()
{
$checar_patrocinador_posicionado_sql = User::where('indicacao', auth()->user()->name)->get();
//dd($checar_patrocinador_posicionado_sql);
foreach($checar_patrocinador_posicionado_sql as $patrocinado){
$teste = $patrocinado->name;
echo $teste;
$verifica_existe_rede_binairo = User::where('referido_1','=',$teste )->orWhere('referido_2','=', $teste)->toSql();
dd($verifica_existe_rede_binairo);
//if($verifica_existe_rede_binairo->isEmpty()){
//}
}
//return view('mmn.derramamento')->with('patrocinados',$patrocinados);
}
}
$checar_patrocinador_posicionado_sql
here comes something?– novic
Opa Virgilio, arrives yes, so q I printed the variable $test but qnd I debug ( dd($verifica_existe_rede_binairo)) $test comes empty
– Matheus Gonzales
Beverly Hills "select * from
users
Wherereferido_1
= ? orreferido_2
= ?"– Matheus Gonzales
->toSql();
It’s like this and putget()
? returns something– novic
not = returned nothing, then I used toSql(); to see what was entering, and saw that nothing entered
– Matheus Gonzales
Collection {#231 #items: [] }
– Matheus Gonzales
Matheus must not be satisfying the search the contents of the variable $test!?
– novic
rsrsrs the funny, q I printo her, and she appears, it’s old Capiroto’s thing
– Matheus Gonzales
next face
User::where('referido_1','=',$teste )
the value ofreferido_1
is equal to the value of $test?– novic
ahammmm yes!!!!
– Matheus Gonzales
complicated without even seeing it! seems a local problem
– novic
What is the version of Laravel and php? try to declare $test = null; before foreach and do so User::Where('referendo_1, $test) plus a toSql thing won’t show the value of $test even if it doesn’t.
– Fatasy Razer
Really? I swore I would show, when toSql’s "?" appears and tosql’s qnd appears the damned
– Matheus Gonzales