pilots Posted March 9, 2008 Report Share Posted March 9, 2008 Kā mysql atlasīt šodienas ierakstus? laiks ierakstiem saglabāts ar NOW() ar tipu INT ja es būtu glabājis date formātā tad es saprotu kā (SELECT * FROM `www` WHERE datums='2007-03-09'), bet man saglabāti tie ieraksti ar funkciju NOW() (.. datetime). Link to comment Share on other sites More sharing options...
bubu Posted March 9, 2008 Report Share Posted March 9, 2008 WHERE datums>=šodienas_datums_00:00:00 and datums<=šodienas_datums_23:59:59 (vai arī datums<rītdienas_datums_00:00:00) Link to comment Share on other sites More sharing options...
pilots Posted March 9, 2008 Author Report Share Posted March 9, 2008 Kā lai es iegūstu iekš tā sql vaicājuma atbilstošo timestampu kāds bija šodien 00:00:00 un 23:59:59? Link to comment Share on other sites More sharing options...
bubu Posted March 9, 2008 Report Share Posted March 9, 2008 Vai nu php pusē ar php funkcijām, vai arī MySQL pusē ar MySQL funkcijām. Link to comment Share on other sites More sharing options...
Pentiums Posted March 9, 2008 Report Share Posted March 9, 2008 date(); Link to comment Share on other sites More sharing options...
pilots Posted March 9, 2008 Author Report Share Posted March 9, 2008 (edited) :D zb jau tu bubu. humorists. ko ta tu tur pentium saki man, ko? Edited March 9, 2008 by pilots Link to comment Share on other sites More sharing options...
bubu Posted March 9, 2008 Report Share Posted March 9, 2008 A ko citu tad tu gaidīji? Jāuzraksta būs $magic_variable un datums pats izskaitļosies? Loģiski tak, ka ar kautkādām funkcijām tas jāskaitļo. Šķir vien vaļā manuāli un skaties kā to panākt. Link to comment Share on other sites More sharing options...
pilots Posted March 9, 2008 Author Report Share Posted March 9, 2008 Ehh. Vienkāršāk tā vien šķiet būs izveidot papildus kolonu un tur glabāt 200x-xx-xx datumu un tad atlasīt. Negrib izpalīdzēt ne pa kam neviens. Link to comment Share on other sites More sharing options...
Aikss Posted March 9, 2008 Report Share Posted March 9, 2008 (edited) $day = date('d'); $query = " SELECT * FROM tabulas_nosaukums WHERE DAY(kolonas_vārds_kurā_stāv_datums) = ' ".$day." ' "; Par šo atbildību neuzņemos! Man vismaz strādā! Edited March 9, 2008 by Aikss Link to comment Share on other sites More sharing options...
Pentiums Posted March 9, 2008 Report Share Posted March 9, 2008 http://lv2.php.net/date Link to comment Share on other sites More sharing options...
Recommended Posts