por que quiero que me muestre resultados solo si la fecha de hoy esta entre esos dos valores
este por ejemplo si me funciona
Código PHP:
<?php
$f1 = $row_tareas['fechadecarga'] ;
$can_dias = 2 ;
$hoy = $row_tareas['fechadecarga'] ;
$fec_vencimi2= date("Y-m-d", strtotime("$f1 + $can_dias days"));
$hoy2 = date("Y-m-d") ;
?>
<?php
mysql_select_db($database_localhost, $localhost);
$query_tareas = "SELECT * FROM tareas WHERE NOW() between '$hoy' AND '$fec_vencimi2' ORDER BY id DESC";
$tareas = mysql_query($query_tareas, $localhost) or die(mysql_error());
$row_tareas = mysql_fetch_assoc($tareas);
$totalRows_tareas = mysql_num_rows($tareas);
?>
en cambio este no me muestra nada
Código PHP:
<?php
$f1 = $row_tareas['fechadecarga'] ;
$can_dias = 2 ;
$can_dias2 = 2 ;
$hoy = $row_tareas['fechadecarga'] ;
$fec_vencimi2= date("Y-m-d", strtotime("$f1 + $can_dias days"));
$fec_vencimi22= date("Y-m-d", strtotime("$f1 + $can_dias2 days"));
$hoy2 = date("Y-m-d") ;
?>
<?php
mysql_select_db($database_localhost, $localhost);
$query_tareas = "SELECT * FROM tareas WHERE NOW() between '$fec_vencimi2' AND '$fec_vencimi22' ORDER BY id DESC";
$tareas = mysql_query($query_tareas, $localhost) or die(mysql_error());
$row_tareas = mysql_fetch_assoc($tareas);
$totalRows_tareas = mysql_num_rows($tareas);
?>