I have two tables,
One with items:
ic_items
item_id name description
1 Pepperino Hot sauce from Argentina
2 Vamos el Couchiero Hot sauce from Spain
one with votes: (flame = 1 vote)
ic_flames
flame_id item_id
1 1
2 1
3 2
Now I want to connect them. So something like this is joining the first table:
item_id name description flame_counter
1 Pepperino Hot sauce from Argentina 2
2 Vamos el Couchiero Hot sauce from Spain 1
I use this query:
SELECT ic_items.item_id, COUNT(ic_flames.flame_id) AS flame_counter
FROM ic_flames
JOIN ic_items ON ic_items.item_id=ic_flames.item_id
GROUP BY ic_items.item_id
When I fill in this query on phpmyadmin I get a table with the flame_counter, but when I go to ic_items I don't see the flame_counter.
How can I get the flame_counter into my ic_items table?