Article View: es.comp.bd.misc
Article #88Re: MySQL - Seleccionar entre 2 fechas
From: Diego
Date: Tue, 06 Dec 2005 02:46
Date: Tue, 06 Dec 2005 02:46
43 lines
2027 bytes
2027 bytes
Manuel, me tira un error : Parse error: parse error in
c:\appserv\www\k-crm\functions.php on line 42
Jamas trabaje con switch, tenes idea que puede ser?
<?php
/*
[---]
mas codigo.php
[---]
*/
function buscar($aniodesde,$mesdesde,$aniohasta,$meshasta){
$fecha_desde = "$aniodesde-$mesdesde";
$fecha_hasta = "$aniohasta-$meshasta";
if ($fecha_hasta < $fecha_desde) {
// Cambio de mes inicial por final si es mayor el final que el
inicial
$tmp = $fecha_hasta;
$fecha_hasta = $fecha_desde;
$fecha_desde = $tmp;
list($aniodesde,$mesdesde) = split("-",$fechahasta);
list($aniohasta,$meshasta) = split("-",$fechadesde);
}
$fecha_desde .= "-01";
switch ($meshasta) {
case 4,6,9,11:
<--------------------- linea 42
$diahasta = 30;
break;
case 2:
// BUSCA A�O BISIESTO
break;
default:
$diahasta = 31;
}
?>
antes de mandar este post, me puse a ver un poco mas a fondo, parece que
$meshasta esta vacio, por eso el error, sin embargo, no logro hacer que pase
la variable
Technical Details
Message-ID:
<dn2u6v$9e2$1@domitilla.aioe.org>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!proxad.net!news.newsland.it!ilaria.aioe.org!aioe.org!not-for-mailReferences:
<dmvhp2$hc3$1@domitilla.aioe.org> <4iTkf.217737$E72.2062265@telenews.teleline.es>Show Full Headers
Complete Article Headers
X-Google-Thread: 106e2f,38ff2cc16b437bf4 X-Google-Attributes: gid106e2f,public X-Google-Language: SPANISH,ASCII Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!proxad.net!news.newsland.it!ilaria.aioe.org!aioe.org!not-for-mail From: "Diego" <diegors@gmail.com> Newsgroups: es.comp.bd.misc Subject: Re: MySQL - Seleccionar entre 2 fechas Date: Mon, 5 Dec 2005 23:46:18 -0300 Organization: Aioe.org NNTP Server Lines: 45 Message-ID: <dn2u6v$9e2$1@domitilla.aioe.org> References: <dmvhp2$hc3$1@domitilla.aioe.org> <4iTkf.217737$E72.2062265@telenews.teleline.es> NNTP-Posting-Host: JSFyygoZhcZ6iaETJQObTw.user.domitilla.aioe.org X-Complaints-To: abuse@aioe.org X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180 X-RFC2646: Format=Flowed; Original X-Newsreader: Microsoft Outlook Express 6.00.2900.2180 X-Priority: 3 X-MSMail-Priority: Normal