Okay... So, I came across the following problem: I have one table that works properly - it holds users' IDs, posts' IDs, posts' content, time that post was made.
I use it to have the following printed out: the content of the post, who is the author of the post and when the post was made. So far everything works just fine.
Now... I have a button that allows the users to vote up for a given post - everything is working just fine here as well. However, now I want to make one more feature that will show who and when has voted. You know, so that beneath each post there will be a list of people who have liked the post and when they've pressed the button.
My idea was to have two tables - the one holding the post's info post_table, and one more table voted_table that will have the user IDs, the time the button was pressed and the post_id that the vote has been made for... But I have no idea how to actually make it. So pretty much my question is:
How can I insert into a table information from another table + some other information on a button's click?