IespiedTehnologijas Posted January 26, 2005 Report Share Posted January 26, 2005 Gribēju paprasīt kur varētu dabūt normālu manuāli par to kā pareizi taisīt viesu grāmatu?! Nu gan no sintakses viedokļa, gan slikto paziņojumu izmešanas! Jo kā izrādās mans stils esot gana slikts... tāpēc gribēju uzzināt par kādu normālu manuāli, saistībā ar forumiem... Izklausās stulbi bet tāda ir mana problēma... :rolleyes: Link to comment Share on other sites More sharing options...
рпр Posted January 26, 2005 Report Share Posted January 26, 2005 tas jau atkarīgs no tā kādas tehnoloģijas tu izmanto... ja slikts stils, tad vērts palasīt kautko par kodēšanas principiem. http://pear.php.net/manual/en/standards.php b.v. valmiera - strauja kā gauja! Link to comment Share on other sites More sharing options...
Venom Posted January 26, 2005 Report Share Posted January 26, 2005 http://paste.php.lv/1573 pārbaudi, vai strādā Link to comment Share on other sites More sharing options...
Forbidden Posted February 2, 2005 Report Share Posted February 2, 2005 (edited) Es nezinu vai sheit ir iistaa vieta kur jautaat, jo mans jautaajums nav iisti par forumu, bet nekas. Taatad manaa lapaa ir taa ka es jaunumus pievienoju no datubazes <?php $mysqli = new mysqli('hosts','users','pass'); $mysqli -> select_db('datubaze'); $result = $mysqli->query("SELECT * FROM teibls"); while($row = $result->fetch_assoc()) { print $row['1'] . ' <br/> ' . $row['2'] . '<br/>'.'<br/>'; } $result->close(); ?> Jautaajums ir shaads - kaa lai es panaaku ka vinjsh velk aaraa ierakstus no datubaazes taa, lai peedeejais ieraksts buutu augshaa, zinu ka vajag izmantot array, bet nemaaku vinju pareizi izmantot. Esmu vel tikai iesaaceejs, tapat kaa kadreiz visi citi... Edited February 2, 2005 by Forbidden Link to comment Share on other sites More sharing options...
Klez Posted February 2, 2005 Report Share Posted February 2, 2005 .... $result = $mysqli->query("SELECT * FROM teibls"); tev noteikti ir kaads id vai datuma lauks. ja tev ir id ar auto increment tad $result = $mysqli->query("SELECT * FROM teibls ORDER BY id ASC"); // vai DESC iisti nezinu no galvas .... Link to comment Share on other sites More sharing options...
bubu Posted February 2, 2005 Report Share Posted February 2, 2005 $result = $mysqli->query("SELECT * FROM teibls ORDER BY pievienoshanas_laiks DESC"); Link to comment Share on other sites More sharing options...
hu_ha Posted February 2, 2005 Report Share Posted February 2, 2005 DESC - 5,4,3,2,1 ASC - 1,2,3,4,5 Link to comment Share on other sites More sharing options...
Forbidden Posted February 2, 2005 Report Share Posted February 2, 2005 (edited) Atvainojiet, ja muljkjiigs jautajums. Bet, ja pievienoju order by, tad met aaraa pazinjojumu - Fatal error: Call to a member function fetch_assoc() on a non-object in index.php on line 33 <?php $mysqli = new mysqli('host','user','pass'); $mysqli -> select_db('index'); $result = $mysqli->query("SELECT * FROM teibls ORDER BY DESC"); while($row = $result->fetch_assoc()) { print $row['1'] . ' <br/> ' . $row['2'] . '<br/>'.'<br>'; } $result->close(); ?> line 33 > while($row = $result->fetch_assoc()) { velreiz atvainojos. Edited February 2, 2005 by Forbidden Link to comment Share on other sites More sharing options...
Venom Posted February 2, 2005 Report Share Posted February 2, 2005 nepareizs query kuru kolonnu ORDER? Link to comment Share on other sites More sharing options...
Forbidden Posted February 2, 2005 Report Share Posted February 2, 2005 (edited) Skaidrs, tur ir jānorāda kuru kolonnu ordereet? tatad jaizmanto bubu variants? nu tagad uztaisiju row 3 un ORDER BY 3 DESC, bet fetch_assoc() jam ta vai ta nepatiik. Edited February 2, 2005 by Forbidden Link to comment Share on other sites More sharing options...
bubu Posted February 2, 2005 Report Share Posted February 2, 2005 (edited) Kādas tev ir kolonnas tabulā teibls? Un, tavai zināšanai, ja notiek mysql kļūda (query funkcija atgriež FALSE, ko ĻOTI ieteicams pārbaudīt), tad arī ĻOTI ieteicams apskatīties kļūdas paziņojumu ar $mysqli->error konstrukcijas palīdzību. Piemērs: $mysqli = new mysqli(...); if (!($result = $mysqli->query('SELECT * FROM ...'))) { echo 'MySQL kļūda: '. $mysqli->error; } else { ... // $result apstrāde $result->close(); } Edited February 2, 2005 by bubu Link to comment Share on other sites More sharing options...
Forbidden Posted February 3, 2005 Report Share Posted February 3, 2005 nu paldies bubu, tagad viss aizgaaja, izraadaas ka laukam id pec kura ordereju vajadzeja vienkarshi varchar.... nevis integer... kaa lidz integer dadomajos pats nezinu... :) velreiz tnx Link to comment Share on other sites More sharing options...
Klez Posted February 4, 2005 Report Share Posted February 4, 2005 nu paldies bubu, tagad viss aizgaaja, izraadaas ka laukam id pec kura ordereju vajadzeja vienkarshi varchar.... nevis integer... kaa lidz integer dadomajos pats nezinu... :) velreiz tnx 13349[/snapback] te nu ira mujkiibas. jebkuru lauku var ORDER`eet vienalga vai tas ir INTEGER VARCHAR vai DATE vai TIME, da jebkuru Link to comment Share on other sites More sharing options...
Forbidden Posted February 4, 2005 Report Share Posted February 4, 2005 Var jau būt...lai gan droši vien tā arī ir kā tu saki...nezinu vienkārši man pirms tam negāja un tagad aizgāja :) Link to comment Share on other sites More sharing options...
bubu Posted February 4, 2005 Report Share Posted February 4, 2005 Var jau būt...lai gan droši vien tā arī ir kā tu saki...nezinu vienkārši man pirms tam negāja un tagad aizgāja :) 13378[/snapback] Tad parādi kodu, kurš tev aizgāja, varbūt kādu citu tas interesē, varbūt kādam citam nākotnē noderēs... Link to comment Share on other sites More sharing options...
Recommended Posts