0
I have a table called bairro
:
I have a table called tabelafrete
:
I have the following SQL
public function getBairroList()
{
$sql = "SELECT * FROM bairro as b Left join tabelafrete as t on b.idBairro = t.idDestino where t.idSaida = 1";
return $this->db->query($sql)->result();
}
Where t.idSaida = 1 (1 = exit district)
It works as follows: A run from the Centro neighborhood - Until the Abranches neighborhood, costs by the table, 2 points. Soon, exit = 1, arrival = 2... But while I list all the neighborhoods, appears only what is already filled in the freight table.
I need: LIST all the neighborhoods, even if you have not filled out the fields... so that you do not need to register one by one.
I need it this way: Can someone help me?
What do you expect to appear in the case of pairs (output, destination) that are not registered? You want to have a rough formula for general cases and add exceptions for traffic, hillside, ...?
– user25930
My intention is to list all the neighborhoods... from the starting point. - Departure: 1 - Neighborhood A, Neighborhood B, Neighborhood C... and in them I will define each value.
– Sr. André Baill
Why take the
where t.idSaida = 1
does not solve your problem?– user25930
It has thesis, it would solve... however, it lists all the exits and not only of the exit 1. As you can look at the print, I have two exits, 1 and 2, if I take out the Where t.idAs it seeks both exit 1, and exit 2, and it would have to be only the exit 1, in case... if I add, it lists only one record, while I do not register all, does not display in the list.
– Sr. André Baill
The exit are all the neighborhoods registered in the table neighborhoods, both exit, as destinations, are the same.
– Sr. André Baill