I have added a time(datetime type) field and used now() to insert the date and time
[php]<?php
include “config.php”;
$name = $_POST[‘name’];
$points = $_POST[‘points’];
$reputation = $_POST[‘reputation’];
//$time = time();
//$date = date(“Y-m-d H:m:s”);
$sql = “INSERT INTO test1 (name, points, reputation, time) VALUES (’$name’, ‘$points’, ‘$reputation’, NOW())”;
if (!mysql_query($sql)) {
die('Error: ’ . mysql_error());
}
?>[/php]
But don’t know how to sort the points accumulated based on the last 24 hrs activity. I know something has to be changed in the bellow code, but cannot figure out what??
[php]include “config.php”;
$totalpoints = mysql_query(“SELECT SUM(points) AS total FROM pointstable”);
while($row = mysql_fetch_array($totalpoints))
{
echo number_format($row[‘points’]);
}[/php]
Pls Help .