I have model that handles with network and user relation. When I try to check whether there is any relation between them before inserting by using count() method, I get Unknown column "id".
In my model configurations, there is many to many relation between networks and users model.
Column not found: 1054 Unknown column 't0.id' in 'field list' with query: "SELECT COUNT(DISTINCT `t0`.`id`) AS count_result FROM `networks_users` AS `t0` WHERE `t0`.`network_id` = '4' AND `t0`.`user_id` = 1"
There's no id column in my networks_user table. So, which is wrong? Was built query or my relations?