I have a company table with the id and name columns. And another table operations with the columns send_id , recib_id . I want to get the results name of send_id and receive_id . And how do I get the two different results in php?
SELECT
companias.id, companias.nombre, operaciones.envia_id,
operaciones.recibe.id
INNER JOIN companias
ON operaciones.recibe_id=companias.id
while( $row = sqlsrv_fetch_array( $stmt, SQLSRV_FETCH_BOTH) ) {
echo "
<tr>
<td>$row[nombre]</td>
<td>$row[nombre]</td>
</tr>
";
}
So I get the name of the person who receives, now I need the name of the sender to appear.