Here's the problem:
I got a row (voters) in my sql database containing nicknames of people who already voted like this:
"Nickname1", "Nickname2", "Nickname3",
But, if I try to use this row in an array to check if the logged in user already voted:
$voters = array($data['voters']);
if (!in_array($_SESSION['user'], $voters)) { // count his vote // } else { echo 'already voted' };
It simply doesn't work. If the user already voted but try anyway, his vote is counted and he's added again in my voters row.
What's wrong with my code ? Thanks