I have a table named Votes like this:
// Votes
+----+---------+------------+---------+-------+------------+
| id | post_id | table_code | user_id | value | timestamp |
+----+---------+------------+---------+-------+------------+
| 1 | 1424 | 2 | 433 | 1 | 1445898101 |
| 2 | 53431 | 4 | 54 | -1 | 1443891149 |
. . . . .
. . . . .
+----+---------+---------+-------+------------+
Now I want to know, how should I check Votes
table that the new vote is belong to his-own-post or that post is from other guy? Should I check $_SESSION['user_id']
with what?