0
I’m updating a system that is developed in pure PHP and I’m putting it in Laravel, however, I’ve never made more than a Join and with "AND" parameters so I would like you to help me, how can I put this SELECT in the Laravel controller?
<?php
$users = "SELECT * FROM ma_usuario u, ma_user_tipo t, ma_user_tipo_rel r
WHERE ma_user_tipo.tp_usr_id=ma_user_tipo_rel.tp_usr_id
AND ma_usuario.usr_id=ma_user_tipo_rel.usr_id
AND ma_usuario.usr_status='Ativo'
AND r.tp_usr_id='$id'
ORDER BY u.usr_id";
?>
As are several parameters I had a knot in the brain and did not understand how to assemble.
Thank you!! I read and reread the documentation and was not understanding how I applied Where.
– Tiago Paza
You’re welcome. You can use two separate Where’s as well, I ended up putting the two together for practicality.
– Andre Gusmao