hai2ukri Posted June 12, 2009 Report Share Posted June 12, 2009 Kods: echo '<tr><td>'.$arr['id'].'</td><td>'.$arr['username'].'</td><td>'.date("d-M-Y H:i",$arr['expire']).'</td></tr>'; Viss strādā ok, tika izvada nepatīkumu notice - Notice: A non well formed numeric value encountered Ko varētu darīt lietas labā? Quote Link to comment Share on other sites More sharing options...
v3rb0 Posted June 12, 2009 Report Share Posted June 12, 2009 php.net/is_numeric un php.net/if palīdzēs Quote Link to comment Share on other sites More sharing options...
hai2ukri Posted June 12, 2009 Author Report Share Posted June 12, 2009 Izpētīju info, kas atrodama abos linkos, bet diemžēl tā arī nesapratu, kas par vainu :( Quote Link to comment Share on other sites More sharing options...
v3rb0 Posted June 12, 2009 Report Share Posted June 12, 2009 tādu kļūdu dabū, ja <?php date("d-M-Y H:i","2009-01-01"); Quote Link to comment Share on other sites More sharing options...
hai2ukri Posted June 12, 2009 Author Report Share Posted June 12, 2009 Bet mysql datubāzē datums tiek saglabāts kā unix timestamps. Quote Link to comment Share on other sites More sharing options...
v3rb0 Posted June 12, 2009 Report Share Posted June 12, 2009 ko rāda echo '<tr><td>'.$arr['id'].'</td><td>'.$arr['username'].'</td><td>'.$arr['expire'].'</td></tr>'; ja timestampu, tad tā notice no citas vietas lec. Quote Link to comment Share on other sites More sharing options...
hai2ukri Posted June 12, 2009 Author Report Share Posted June 12, 2009 Tevis dotais kods izvada pašu timestampu - 1281376800, taču notice pazūd. Iekopējot atpakaļ veco kodu, notice atkal parādās. Noticē norādīts, ka kļūda 238 rindiņā, tā ir tieši tā, kuru norādīju pirmajā postā. Quote Link to comment Share on other sites More sharing options...
EdgarsK Posted June 12, 2009 Report Share Posted June 12, 2009 (edited) pamēģini echo '<tr><td>'.$arr['id'].'</td><td>'.$arr['username'].'</td><td>'.(is_numeric($arr['expire']) ? date("d-M-Y H:i",$arr['expire']) : '---').'</td></tr>'; un vēl protams vienmēr visu var noslēpt, bet tas nav labākais variants, vienmēr visu jāizlabo echo '<tr><td>'.$arr['id'].'</td><td>'.$arr['username'].'</td><td>'.@date("d-M-Y H:i",$arr['expire']).'</td></tr>'; Edited June 12, 2009 by EdgarsA Quote Link to comment Share on other sites More sharing options...
hai2ukri Posted June 12, 2009 Author Report Share Posted June 12, 2009 echo '<tr><td>'.$arr['id'].'</td><td>'.$arr['username'].'</td><td>'.(is_numeric($arr['expire']) ? date("d-M-Y H:i",$arr['expire']) : '---').'</td></tr>'; Ar šo notice pazūd, taču tur kur būtu jāizvada kāds 2010. gada datums un laiks, tiek izvadītas divas domuzīmes ( -- ). Ar 2009. gadu viss OK. Quote Link to comment Share on other sites More sharing options...
marcis Posted June 12, 2009 Report Share Posted June 12, 2009 Ko saka? var_dump($arr['expire']); Quote Link to comment Share on other sites More sharing options...
v3rb0 Posted June 12, 2009 Report Share Posted June 12, 2009 ta tur viens expire ir timestamps, cits strings. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.