euphoric Posted October 6, 2009 Report Share Posted October 6, 2009 Datu bāzē saglabājas ieraksti piem : id = '1' name = 'friend' abc = 'ok' Izvadu ciklā šādus ierakstus kur abc='ok' Katrs ieraksts piem. 10 sant Vaig saskaitīt cik ieraxtu kopā un no tā izrēķināt, izvadīt cik LS un Santīmi. (kopā) Protams pats kaut kā izmocītu to visu, bet domāju ka tas kods rezultātā būs baigi šausmīgs. Tapēc, varbūt varat ieteikt kadas funkcijas, kas tieši ar tām naudam saistītas. Lai vismaz būtu uz pareizā ceļa. Paldies :) Quote Link to comment Share on other sites More sharing options...
waplet Posted October 6, 2009 Report Share Posted October 6, 2009 $lati = floor($kopeejaanauda); $santimi = $kopeejaanauda % 100; Quote Link to comment Share on other sites More sharing options...
ohmygod Posted October 6, 2009 Report Share Posted October 6, 2009 (edited) Select count(*) as skaits FROM `tabula` WHERE `abc` = 'ok' number_format($row['skaits'], 2, '.', ' '); Edited October 6, 2009 by ohmygod Quote Link to comment Share on other sites More sharing options...
Aleksejs Posted October 6, 2009 Report Share Posted October 6, 2009 Ierakstu skaitu dabū ar: SELECT COUNT(id) AS skaits FROM tabula WHERE ... nosacījums Tad dabūtās skaits kolonnas vērtību pareizini ar 10 (ja gribi santīmos) vai 0.1 (ja gribi latos). Quote Link to comment Share on other sites More sharing options...
euphoric Posted October 6, 2009 Author Report Share Posted October 6, 2009 ow, paldies, cik vienkārši :) Es būtu tur 'kosmisko' function(), sataisījis :D Paldies liels :) 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.