client.print("GET http://localhost/mysql_connect.php?temp1="); // send this to apache on server to call "
client.print("GET /mysql_connect.php?temp1="); // send this to apache on server to call "
Also suggest you use "HTTP/1.0" instead and skip the "User-Agent", "Accept", and "Connection: close:" lines; HTTP/1.0 doesn't use persistent connections so "Connection: close" is unnecessary and the User-Agent and Accept headers are always unnecessary. Also, using a "Host:" header with an IP address is goofy and you should skip that as well; the intent of the "Host:" header is to use a hostname so the web server can run name-based virtual hosting when multiple domain names resolve to a single IP, but again that doesn't make sense with an IP address.
As an added option if you skip the "HTTP/1.0" string entirely your response from the web server will have no headers with it; just content.
$sql="INSERT INTO temperatures (temp1) VALUES ('$_GET[temp1]')";
You have single quotes around your $_GET[temp1] value; are you storing the temp in a text (not numeric) field type?