strong-storm Posted March 1, 2005 Report Share Posted March 1, 2005 Es īsti neizprotu kā lai zina kurš komentārs ir pie kura raxta ja lieto MySQL? Link to comment Share on other sites More sharing options...
рпр Posted March 1, 2005 Report Share Posted March 1, 2005 Es īsti neizprotu kā lai zina kurš komentārs ir pie kura raxta ja lieto MySQL? 14398[/snapback] shis vareetu buut dienas labaakais jautaajums. Link to comment Share on other sites More sharing options...
Kavacky Posted March 1, 2005 Report Share Posted March 1, 2005 shis vareetu buut dienas labaakais jautaajums.Ka tik pat uz gada nepretendē... Link to comment Share on other sites More sharing options...
Nexodus Posted March 1, 2005 Report Share Posted March 1, 2005 Man table komenti ir lauks raksts, kur tiek ierakstīta info par to kuram rakstam(pēc ID) pievienojas koments. Un tad query vienkārši atlasa! Query ir apmēram šitāds SELECT * FROM teibls WHERE raksts(nu pofig kas)="$id" nu un uzliek ka $id = $_GET['id']; Link to comment Share on other sites More sharing options...
sviesc Posted March 1, 2005 Report Share Posted March 1, 2005 labi jautājumu tā arī īsti neizpratu, bet ja tas ir tas ko vēlējies zināt tad lūdzu DB tabulas: raxts id | text comments id | raxtaid | text un tasi elemantāru queriju SELECT * FROM comments WHERE raxtaid='$_GET[id]' ORDER BY id ASC protams pastāv daudzi dažādu varianti, bet šitas ir viens no vienkāršākajiem Link to comment Share on other sites More sharing options...
rudzis Posted March 2, 2005 Report Share Posted March 2, 2005 TXT rulllzzz :D Link to comment Share on other sites More sharing options...
strong-storm Posted March 2, 2005 Author Report Share Posted March 2, 2005 Būtībā doma bija par to kā piešķirt specifisko identifikātoru tam rakstam. Link to comment Share on other sites More sharing options...
рпр Posted March 3, 2005 Report Share Posted March 3, 2005 auto_increment Link to comment Share on other sites More sharing options...
Venom Posted March 3, 2005 Report Share Posted March 3, 2005 ne tur iepeistoju id bigint(20) unsigned NOT NULL auto_increment,... PRIMARY KEY (id), UNIQUE KEY id (id) Link to comment Share on other sites More sharing options...
bubu Posted March 3, 2005 Report Share Posted March 3, 2005 Vai tad primary key automātiski neveido unikālo indeksu, kāpēc vēlviens indekss ar UNIQUE jātaisa? Link to comment Share on other sites More sharing options...
Venom Posted March 3, 2005 Report Share Posted March 3, 2005 nokopējās no create statementa Link to comment Share on other sites More sharing options...
Recommended Posts