I need to store in the subscription database (id - someone I read). What is the best type to do for this and how to save the data, in what form?

    3 answers 3

    Create the subscribers table, and there for example make 2 fields, id - who is subscribed and id to whom is subscribed

    • And type VARCHAR 32? - Zow
    • @Zow, strange question. What type of data you are going to store - this and the type of field you choose. - Deonis
    • No, for id int - Pavel Dura
    • User field type in the subscriptions table - must match the user field type from the user table. - istem
    • ahah) oh well nafig?)) - Pavel Dura

    For kosher, two tables with the following parameters are created: The first with three fields, (int) id subscription number, (int) id who subscribed + (int) id to whom.

    And the first id field of the subscription number is auto-incrementing.

    The second table for example with a description of users, (int) id, (varchar) name, (varchar) email, etc., so as not to get confused about who is who in your subscriptions id.

    Next, link the tables.

      Create a table, the fields you need for example: id_1 and id_2. Since the numbers will be stored there, the type is integer (int).