Difficulty with mysqli_fetch_object

0

I'm performing the function as follows:

Through a query:

<?php
[...]
$sql = 
"SELECT f_u.*, f_i.*, f_g.* FROM form_user AS f_u 
LEFT JOIN form_imovel AS f_i ON f_i.imovel_id = $imovel_id 
LEFT JOIN form_img AS f_g ON f_g.imovel_id = $imovel_id WHERE f_u.user_id = 
$user_id"; 
$result = mysqli_query($con,$sql);
$row_cont = mysqli_num_rows($result);
echo $row_cont;
while($rowb = mysqli_fetch_object($result))
{    echo '$rowb->file_name';
} 
?>

But in the output I get the line count ( $row_cont=3 ), but the result of while returns only 2 results.

Edit This query is done in 3 tables where form_user and form_imovel I have only 1 record and in the form_img 3 table with the same id of imovel_id .

form_user  | form_imovel       | form_img
----------   ------------------  -----------------------
user_id      user_id| imovel_id  imovel_id|file_name
77           77       7          7         seven.jpg
                                 7         seven7.jpg
                                 7         seven77.jpg
    
asked by anonymous 18.04.2017 / 19:34

0 answers