I have array : $ids=[123,234,567,8910,11324,1];
how to add this to one field in mysql.
After adding check if this id exists if it does not then add it to the same field.
I am looking at something like this.How do I do that .I really appreciate any help .Thanks in Advance.:
---------------------
| all_blocked_users |
---------------------
| 123,234,567 |
---------------------
create table blocked_users (blocker_id int references users (id), blockee_id int references users (id));. Now, to get a list of users that user A has blocked,select blockee_id from blocked_users where blocker_id = A. To see if a user A has blocked user B,select count(*) from blocked_users where blockee_id = B and blocker_id = A. To find a list of most-blocked users (possible troublemakers),select blockee_id, count(blocker_id) blockers from blocked_users group by blockee_id order by blockers desc. Try doing that with a comma-separated list in a reasonable amount of time... :)references, keys, and all that fun stuff. Also, google "1NF" and "sql anti-patterns".