please use [php][/code] tags when displaying php
your time stamps, are they unix time stamps or YYYY-MM-DD HH:MM:SS timestamps?
if its unix timestamp you can do:
$query = "SELECT * FROM incidents WHERE type LIKE 'A computer' AND WHERE thetime >= ".(time() - 60*60*24*40);
$result = mysql_query($query) or die("SELECT Error: " . mysql_error());
if its the ladder, someone more knowledgeable then me can help you out further.
additionally, your displaying method of showing info from the database is rather... questionable... you're using foreach to show each value of the array, then closing the tables row in the loop.. then closing the table on the while loop.. how about trying something like
print "There are $num_rows records.<table width=200 border=1>\n";
while ($get_info = mysql_fetch_row($result)){
print "<tr>\n";
foreach ($get_info as $field)
print "\t<td><font face=arial size=1/>$field</font></td>\n";
}
print "</tr>\n";
}
print "</table>\n";
//or, if you wanted better control of how each cell will be displayed..
print "There are $num_rows records.<table width=200 border=1>\n";
while ($get_info = mysql_fetch_row($result)){
print "<tr>\n";
print "\t<td><font face=arial size=1/>{$get_info['column1']}</font></td>\n";
print "\t<td><font face=arial size=1/>{$get_info['column2']}</font></td>\n";
//etc...
print "</tr>\n";
}
print "</table>\n";
//(Where column1 & column2 are the columns you wish to display)