So here is how would approach to debugging this problem:
1) Check if the form is actually submitted. Put this on the top of your PHP file (note: for debugging only)
echo "I have reached my destination";
die();
2) Check if you are submitting via POST or GET. Or easier, replace $_POST with $_REQUEST, which contains both $_POST and $_GET.
if(isset($_REQUEST['extract'])){
3) Ensure the connection to the database is opened.
4) Provide your script the means to tell you if the query executed successfully
$myquery = mysql_query("TRUNCATE TABLE temp") or die("Error: ".mysql_error());
5) Ensure you are looking at the right place for the changes
You would be surprised how easy it is to get confused with multiple databases opened.
Double check the ip address of your DB server, your DB and table name and contents.
One of the above 5 steps will tell you what went wrong.