Puika1 Posted July 25, 2009 Report Share Posted July 25, 2009 kas man jādara,lai šajā scriptā uzliktu ka lietotājus neizvelk visus,bet kādu noteiktu grupu,piemēram admin? <?php define('WWW','http://kaut kads webs/'); //Tavas web lapas adrese include_once('forums/conf_global.php'); //Celš uz foruma config failu $link = mysql_connect($INFO['sql_host'],$INFO['sql_user'],$INFO['sql_pass']); mysql_query('use '.$INFO['sql_database'].';'); $page = '<div id="userlist">'; $result = mysql_query('select t1.id,t1.members_display_name,t2.avatar_location from '.$INFO['sql_tbl_prefix'].'members t1 join '.$INFO['sql_tbl_prefix'].'member_extra t2 on (t1.id = t2.id);'); if (!empty($result)) { while ($r = mysql_fetch_array($result)) { if ($r[2] == "") { $avatars = "forums/uploads/default.jpg" ; } else { $avatars = "forums/uploads/$r[2]" ; } $page .='<p> <a href="'.WWW.'forums/index.php?showuser='.$r[0].'"> <img class="avatar" src="'. WWW .''. $avatars .'" alt="'.$r[1].'" /> '.$r[1].'</a> </p>'; } } $page .='</div>'; mysql_close($link); echo $page; ?> Quote Link to comment Share on other sites More sharing options...
airbus Posted July 25, 2009 Report Share Posted July 25, 2009 if($row->mgroup == "GRUPAS ID") { Quote Link to comment Share on other sites More sharing options...
Puika1 Posted July 25, 2009 Author Report Share Posted July 25, 2009 airbus to es aptuveni zināju bet kur jāliek? Quote Link to comment Share on other sites More sharing options...
airbus Posted July 26, 2009 Report Share Posted July 26, 2009 Nu meigini kaut kur zem konektiem Quote Link to comment Share on other sites More sharing options...
Puika1 Posted July 27, 2009 Author Report Share Posted July 27, 2009 meginaju nesanāk Quote Link to comment Share on other sites More sharing options...
airbus Posted July 27, 2009 Report Share Posted July 27, 2009 Zem si $result = mysql_query('select t1.id,t1.members_display_name,t2.avatar_location from '.$INFO['sql_tbl_prefix'].'members t1 join '.$INFO['sql_tbl_prefix'].'member_extra t2 on (t1.id = t2.id);'); ieliec if($row->mgroup == "GRUPAS ID") { Quote Link to comment Share on other sites More sharing options...
Puika1 Posted July 27, 2009 Author Report Share Posted July 27, 2009 es jau liku meta ara mistisku eror :) Quote Link to comment Share on other sites More sharing options...
kechums Posted July 27, 2009 Report Share Posted July 27, 2009 Priekš kam tur if'u? Kverijā var pielikt tādu zvēru kā WHERE. airbus, ja viņš tieši tā, kā tu teici izdarīs, tad pieļaus divas kļūdas vienlaicīgi, tas if's būtu jāliek while ciklā nevis pirms tā, un otrā lieta, tur ir mysql_fetch_array, nevis object. Quote Link to comment Share on other sites More sharing options...
Puika1 Posted July 27, 2009 Author Report Share Posted July 27, 2009 ko tad man īsti darīt ar to "WHERE"? Quote Link to comment Share on other sites More sharing options...
anonīms Posted July 27, 2009 Report Share Posted July 27, 2009 $result = mysql_query('select t1.id,t1.members_display_name,t2.avatar_location from '.$INFO['sql_tbl_prefix'].'members WHERE grupa = tava_super_grupat 1 join '.$INFO['sql_tbl_prefix'].'member_extra t2 on (t1.id = t2.id);'); Quote Link to comment Share on other sites More sharing options...
Puika1 Posted July 28, 2009 Author Report Share Posted July 28, 2009 anonīms es mazliet nesapratu šo vietu 'members WHERE grupa = tava_super_grupat 1 join '.$INFO['sql_tbl_prefix'] ka man te rakstit "tava_super_grupat 1 join " ? Quote Link to comment Share on other sites More sharing options...
airbus Posted July 28, 2009 Report Share Posted July 28, 2009 Grupas ID, piemēram 'members WHERE grupa = 11 '.$INFO['sql_tbl_prefix'] Es tā saprātu Quote Link to comment Share on other sites More sharing options...
Puika1 Posted July 28, 2009 Author Report Share Posted July 28, 2009 mēģināju jau rāda baltu lapu Quote Link to comment Share on other sites More sharing options...
airbus Posted July 28, 2009 Report Share Posted July 28, 2009 Nu protams ka neradīs... Jo tavā datubazē nav tadas tabulas grupa ir jaatrod attiecīga tabula un jaieliek. Quote Link to comment Share on other sites More sharing options...
Puika1 Posted July 29, 2009 Author Report Share Posted July 29, 2009 ka tieši? 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.