*jancis38* Posted February 12, 2008 Report Share Posted February 12, 2008 Tātad uztaisiju komentāru skriptu, ir forma darbojas ar $_POST Pievienojot komentāru jaunākais ieraksts failā dodas uz leju, kā varētu izdarīt, lai jaunākais ieraksts tiek pievienots faila augšgalā? Link to comment Share on other sites More sharing options...
andrisp Posted February 12, 2008 Report Share Posted February 12, 2008 Var jā. Link to comment Share on other sites More sharing options...
Grey_Wolf Posted February 12, 2008 Report Share Posted February 12, 2008 vienigi: ielasi visus ierakstus... tad savieno ar jaunako --> ieraksti atpakalj... savadak nekaa.... Link to comment Share on other sites More sharing options...
*jancis38* Posted February 12, 2008 Author Report Share Posted February 12, 2008 Un kā lai to dabū gatavu? Link to comment Share on other sites More sharing options...
Grey_Wolf Posted February 12, 2008 Report Share Posted February 12, 2008 ar PHP koda palidzibu (iespejams izmantot arii citas programmesanas valodas ..) ;) Link to comment Share on other sites More sharing options...
anonīms Posted February 12, 2008 Report Share Posted February 12, 2008 ORDER BY id DESC Link to comment Share on other sites More sharing options...
andrisp Posted February 12, 2008 Report Share Posted February 12, 2008 anonīms, laikam nepamanīji, ka viņš neizmanto db. Link to comment Share on other sites More sharing options...
anonīms Posted February 12, 2008 Report Share Posted February 12, 2008 Nepamaniju gan, jo tur tas nav rakstīts :) Link to comment Share on other sites More sharing options...
andrisp Posted February 12, 2008 Report Share Posted February 12, 2008 Vai tiešām ? :) "Pievienojot komentāru jaunākais ieraksts failā dodas uz leju" Link to comment Share on other sites More sharing options...
anonīms Posted February 12, 2008 Report Share Posted February 12, 2008 fails - komentāri.php ieraksts - ņemts no db :) :P Es tā varu visu dienu... Link to comment Share on other sites More sharing options...
andrisp Posted February 12, 2008 Report Share Posted February 12, 2008 Ok, es tagad sapratu, kā tu izlasīji to tekstu. Un tiešām tur nav teikts, ka tieši failā raksta. :) Link to comment Share on other sites More sharing options...
Aleksejs Posted February 12, 2008 Report Share Posted February 12, 2008 Nu, ko... spodrinām kristāla lodes: variants A - tiek izmantota datunāze - atbilde ORDER BY x DESC variants B - viss rakstās vienā failā - atbilde (viens no variantiem): $datne=fopen('komentaru_fails.php','r+'); fwrite($datne,$komentaara_teksts); fclose($datne); Link to comment Share on other sites More sharing options...
Recommended Posts