sandis_m Posted January 30, 2011 Report Share Posted January 30, 2011 Nevaru saprast, kā lai dabon uz lietotāja profila bildes saņemtās dāvanas. SQL: <?php $friends->query = " SELECT `lietotaji`.*, `davanas`.* , `davanu_faili`.* FROM `lietotaji` LEFT JOIN `davanas` ON `lietotaji`.uid = `gifts`.sanemejs LEFT JOIN `davanu_faili` ON `davanas`.tips= `davanu_faili`.id GROUP BY `lietotaji`.uid "; ?> Un ir šādi: Bet konkrēti vajadzētu, lai būtu visi saņemtie kēksiņi. Vai tiešām vajadzēs izmantot: while($lietotaji){ //utt utt while($davanas){ // utt utt } } Link to comment Share on other sites More sharing options...
spainis Posted January 30, 2011 Report Share Posted January 30, 2011 bez group by Link to comment Share on other sites More sharing options...
briedis Posted January 30, 2011 Report Share Posted January 30, 2011 Ja tās dāvanas jāattēlo pāris vietās, domājams, ka vieglāk to darīt ar CSS. Imo draugiem.lv tā ir. Link to comment Share on other sites More sharing options...
ezis Posted January 30, 2011 Report Share Posted January 30, 2011 Izvelc visus kēksiņus ;D no db, tad ar randomā samet viņus pa visu bildi. Link to comment Share on other sites More sharing options...
sandis_m Posted January 30, 2011 Author Report Share Posted January 30, 2011 bez group by Noņēmu group by, bet tagad lietotāji dublējas Nū, man jau ir randomā <?php while($tiripiri){ ?> $rand_x = mt_rand(1,90); $rand_y = mt_rand(1,90); <div class="gifta"> <div style="top:<?php echo $rand_y;?>px;left:<?php echo $rand_x;?>px;background: url('<?php echo $data["file_sm"];?>') no-repeat scroll center center;width:58px;height:57px;"> </div> </div> <?php echo $name." "$lastname;?> <!-- utt --> <?php } ?> Link to comment Share on other sites More sharing options...
Kaklz Posted January 30, 2011 Report Share Posted January 30, 2011 Palasi par GROUP_CONCAT: http://dev.mysql.com/doc/refman/5.0/en/group-by-functions.html#function_group-concat Link to comment Share on other sites More sharing options...
sandis_m Posted January 30, 2011 Author Report Share Posted January 30, 2011 Palasi par GROUP_CONCAT: http://dev.mysql.com/doc/refman/5.0/en/group-by-functions.html#function_group-concat Hell, yeah! Nebiju iedomājies par šito. Paldies :) Link to comment Share on other sites More sharing options...
Recommended Posts