I have a list of products. The products are stored in table products. Each product is located in a city. The name of the city is stored in the table cities.
The display of each product (thumbnail + name + price) is in a loop.
So first I extract the data by SQL query:
$db = JFactory::getDBO();
$sql_query = 'SELECT deal_id, name FROM deals,cities WHERE products.location_id = cities.id';
$result=mysql_query($sql_query);
I store everything in an Array:
$array_result = array();
while($row_deal = mysql_fetch_array($sql_query)){
$array_result[] = $row_deal;
}
Then start the loop to display the list of products. I have $item->id for identification of the product:
LOOP
......
......
What I have to put here to display the city?
echo ????
......
......
END LOOP