djmartins Posted August 17, 2005 Report Share Posted August 17, 2005 Baigaa stelle.Man ir cip tabula news kura ir rows date.Tas viss butu kartiba.Bet ka lai tagad to datumu izvadu ara?Ja cip taisa ka izvada no tas tabulas ar $res tad vins man izvada kaut kadu ciparu virkni tikai.Vot sito lietu es nerubiju. Link to comment Share on other sites More sharing options...
bubu Posted August 17, 2005 Report Share Posted August 17, 2005 Kādā formātā tev tas laiks tur glabājas? Timestampā? Tad skat fju date() php pusē, vai meklē MySQL pusē konvertācijas fju. Link to comment Share on other sites More sharing options...
djmartins Posted August 17, 2005 Author Report Share Posted August 17, 2005 nu man glabajas datetime! Link to comment Share on other sites More sharing options...
bubu Posted August 17, 2005 Report Share Posted August 17, 2005 Esi 100% pārliecināts? Tad parādi kā tu veic pieprasījumu. Link to comment Share on other sites More sharing options...
djmartins Posted August 17, 2005 Author Report Share Posted August 17, 2005 <? $host == "localhost"; $port == "2005"; $user == "janis"; $pass == "peteris"; $database == "db"; $db = mysql_connect("$host:$port", "$user", "$pass"); $result = mysql_query("SELECT * FROM news;", $db); echo("<table width=92% bgcolor=#C0C0C0>"); echo("<tr>"); echo("<td align=left>$res[3]</td>"); echo("</tr>"); echo("</table>"); ?> cip $res3 ir tas datums :D Laikam jau kaut kas skiibi! :) Link to comment Share on other sites More sharing options...
bubu Posted August 17, 2005 Report Share Posted August 17, 2005 Parādi kverija "describe news" rezultātu. Link to comment Share on other sites More sharing options...
djmartins Posted August 17, 2005 Author Report Share Posted August 17, 2005 0000-00-00 Taa izskatas kad izvada!cip default Link to comment Share on other sites More sharing options...
bubu Posted August 17, 2005 Report Share Posted August 17, 2005 (edited) a ko man tas izsaka? tu vispār esi pārliecināts, ka tabulā ir ielikts normāls datums? Edited August 17, 2005 by bubu Link to comment Share on other sites More sharing options...
djmartins Posted August 17, 2005 Author Report Share Posted August 17, 2005 Ai lab karoc neko nerubiju.Un vispar neesmu parliecinats :) Link to comment Share on other sites More sharing options...
Venom Posted August 17, 2005 Report Share Posted August 17, 2005 Pie INSERT liki iekš tās kolonnas NOW() vai date('Y-m-d H:i:s')? droši vien ka jau nē. un no kurienes tad parādīsies vērtība? Link to comment Share on other sites More sharing options...
djmartins Posted August 17, 2005 Author Report Share Posted August 17, 2005 var kads uzrakstit scripteli kaa tam smuki butu jaizskatas? Link to comment Share on other sites More sharing options...
Venom Posted August 17, 2005 Report Share Posted August 17, 2005 mysql_query("INSERT INTO tabula SET datums=NOW(),lauks='vērtība',lauks2='vērtība' "); pēc tam ar SELECTu būtu no datums jāatgriež kaut kas līdzīgs 2005-08-17 14:20, bet izmantojot DATE_FORMAT(), YEAR(), MONTH() u.c. f-cijas varētu atlasīt pēc att. laika parametra/formatēt datumu Link to comment Share on other sites More sharing options...
Recommended Posts