How can an Arduino Mega 2560+Wifi Shield 2.0 (SeeedStudio) receive data from database in a XAMPP server on my PC?
You should forget about the $_SESSION["ID"]; on PHP side, because you are working stateless without any session!
You should give a parameter for identifying your variable from arduino to php script - is this the temp=0? If so you need to exchange 

$sql="SELECT temp FROM perfil, client WHERE perfil.ID ='$id'";


with

$sql="SELECT temp FROM perfil, client WHERE perfil.ID =" . $_GET["temp"];


assuming that perfil.id is only an integer - if it is a string, then add "'".