Any idea why this wont work? I have a feeling its the row name I have given it.
It doesnt echo anything
$result = mysql_query("SELECT UNIX_TIMESTAMP(datetime) FROM voters WHERE ip='$ip'") or die(mysql_error());
while($row = mysql_fetch_array($result)) {
$unixtimestamp = $row['UNIX_TIMESTAMP(datetime)'];
echo $unixtimestamp;
}
Nevermind, datetime is not a reserved word, but I still highly recommend not using it and choosing a better column name. :), but the below still stands.
Alias the column, makes pulling it out in the array easier later on:
Should work.