//calculo entre 2 fechas $dias= mysql_query("SELECT TO_DAYS(fecha2) - TO_DAYS(fecha1) FROM tabla"); $calculo = mysql_result($dias,0);