Pentiums Posted December 16, 2010 Report Share Posted December 16, 2010 Labdien. Kodējot kārtējo valsts pasūtīto projektu, es uzdūros lielai problēmai. Es nezinu, kā lapā var attēlot tekstu izmantojot PHP. Ir lapa, kur esmu uzrakstījis kodu, kas no datubāzes izvelk tekstus, bet nezinu kā attēlot!!! $result = mysql_query("SELECT id, teksts, datums FROM aktualitates ORDER BY id DESC LIMIT 10"); if(mysql_num_rows($result) > 0) { while($data = mysql_fetch_array($result)) { //Te es nemāku to sarežģīto lietu izdarīt. } } else { die('Viss ir štokos, te nav nevienas aktualitātes, tāpēc es neko te nerādīšu jums!!! sapratāt??'); } Quote Link to comment Share on other sites More sharing options...
xmas12 Posted December 16, 2010 Report Share Posted December 16, 2010 (edited) $result = mysql_query("SELECT id, teksts, datums FROM aktualitates ORDER BY id DESC LIMIT 10"); if(mysql_num_rows($result) > 0) { while($data = mysql_fetch_array($result)) { echo "'.$data['teksts'].'"; } } else { die('Viss ir štokos, te nav nevienas aktualitātes, tāpēc es neko te nerādīšu jums!!! sapratāt??'); } Edited December 16, 2010 by xmas12 Quote Link to comment Share on other sites More sharing options...
Pentiums Posted December 16, 2010 Author Report Share Posted December 16, 2010 (edited) PALDIES!!!!!!!! bet tur bez pēdiņām arī jiet!!! Edited December 16, 2010 by Pentiums Quote Link to comment Share on other sites More sharing options...
xmas12 Posted December 16, 2010 Report Share Posted December 16, 2010 PALDIES!!!!!!!! bet tur bez pēdiņām arī jiet!!! NUjā, bet vnk es pēdiņas izmantoju, jo tad es vēsi varu ielikt jebkādu tekstu iekš izvades un utt.. Bet nu izmanto kā tev labāk. Es ieteiku pēdiņas izmantot. ;) Quote Link to comment Share on other sites More sharing options...
Pentiums Posted December 16, 2010 Author Report Share Posted December 16, 2010 (edited) PALDIES! :> Edited December 16, 2010 by Pentiums Quote Link to comment Share on other sites More sharing options...
marcis Posted December 16, 2010 Report Share Posted December 16, 2010 Es ieteiktu neizmantot to, kas ir lieks, pie tam neizmantot nepareizi :) Quote Link to comment Share on other sites More sharing options...
indoom Posted December 16, 2010 Report Share Posted December 16, 2010 xmas12, ieteiktu pārskatīt php manuāli echo "'.$data['teksts'].'"; Pat, ja ignorē parsēšanas kļūdu, tad interesanti, kāpēc tekstam sākumā un beigās gribi likt '. un .'? Quote Link to comment Share on other sites More sharing options...
Pentiums Posted December 16, 2010 Author Report Share Posted December 16, 2010 @indoom, lai varētu likt kautkur citur iekšā! Quote Link to comment Share on other sites More sharing options...
Pentiums Posted December 16, 2010 Author Report Share Posted December 16, 2010 :D:D:D Quote Link to comment Share on other sites More sharing options...
daGrevis Posted December 16, 2010 Report Share Posted December 16, 2010 Tā valsts patiešām ir tik stulba...? Jel! Quote Link to comment Share on other sites More sharing options...
sandis_m Posted December 19, 2010 Report Share Posted December 19, 2010 Tā valsts patiešām ir tik stulba...? Jel! ++ Quote Link to comment Share on other sites More sharing options...
marrtins Posted December 19, 2010 Report Share Posted December 19, 2010 (edited) Kas tādus dauņus algo?! Edit: nē, nu tā vienkārši nevar būt. Tēma ir domāta kā nenormāls joks, vai ne? Edited December 19, 2010 by marrtins Quote Link to comment Share on other sites More sharing options...
php newbie Posted December 19, 2010 Report Share Posted December 19, 2010 Petrosjana māceklis. labi joko. Quote Link to comment Share on other sites More sharing options...
Pentiums Posted December 20, 2010 Author Report Share Posted December 20, 2010 joks, joks. 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.