Array question.. easy
Posted: Wed Feb 09, 2005 10:04 pm
I'm getting a "in_array(): bad argument for second parameter" error for this:
The array when printed to the browser is "Array."
How can I fix this to be a list of names from the query?
Code: Select all
$date = date("Ymd");
$alreadyvotedsql = "SELECT whovoted FROM faceoffvotes WHERE faceoffid = '$faceoffid' AND date = '$date'";
$alreadyvotedquery = mysql_query($alreadyvotedsql);
$alreadyvotedarray = mysql_fetch_array($alreadyvotedquery);
if(in_array($_COOKIEї'username'], $alreadyvotedarray)){ echo "You have already voted on this faceoff matchup today. You can vote again tommorow"; require 'footer.php'; die(); }
}How can I fix this to be a list of names from the query?