while ($row = mysql_fetch_array($results)){
$row['fieldName']
}
$query = "SELECT SQL_CALC_FOUND_ROWS *
FROM realestate
INNER JOIN users ON id_user = users.id
LEFT JOIN pic ON id_realestate = realestate.id
{$place}
{$offer}
{$type}
{$price}
group by realestate.id
ORDER BY {$order}
LIMIT 0,10";
i have two tables users and realestate. both have the field id. what should be in the fileldname above to get id in users table?
You should name the fields in the query: if you do
users.id AS user_id, then PHP will see auser_idfield.Of course, in this particular case it doesn’t matter, since you have two equivalent fields:
id_userandid_realestate.