homers Posted September 27, 2009 Report Share Posted September 27, 2009 Tatad gribu izvilkt lietotaja profilu monitorā, jā spēletaja niks ir reģistrets iekš forumā uz viņu rada linku, bet jā nav vienkarši rada spēletaju niku bez linka. Rekur kaut kads kods man ir, bet viņš neiet vienkarši rada niku bez linka: $name=SubStr($st,0,StrPos($st,chr(0))); $a= mysql_fetch_row(mysql_query("SELECT name FROM ibf_members")); $name_f = $a[0]; $af= mysql_fetch_row(mysql_query("SELECT id FROM ibf_members WHERE name=$name_f")); $name_f_id = $af[0]; if($name == $name_f){ echo "<a href='?q=user&id=".$name_f_id."'>$name</a>"; } else { echo "$name"; } Quote Link to comment Share on other sites More sharing options...
EdgarsK Posted September 27, 2009 Report Share Posted September 27, 2009 (edited) <?php $name=substr($st,0,strpos($st,chr(0))); $check=mysql_query("select id from ibf_members where name='$name'"); if(mysql_num_rows($check)) { $names=mysql_fetch_array($check); echo "<a href='?q=user&id=".$names["id"]."'>$name</a>"; }else echo $name; ? shaadi darbotos ? Edited September 27, 2009 by EdgarsA Quote Link to comment Share on other sites More sharing options...
homers Posted September 27, 2009 Author Report Share Posted September 27, 2009 Nē, tapat rada spēletaja niku bez linka Quote Link to comment Share on other sites More sharing options...
marcis Posted September 27, 2009 Report Share Posted September 27, 2009 Meklē tepat forumā, atceros, ka arī šāda tēmas modifikācija ir pārrunāta. Quote Link to comment Share on other sites More sharing options...
cunamiX Posted September 27, 2009 Report Share Posted September 27, 2009 (edited) Pamēģini šādi <?php $name=substr($st,0,strpos($st,chr(0))); $check=mysql_query("SELECT id FROM ibf_members WHERE members_display_name = '$name'"); $check2=mysql_fetch_assoc($check); if(isset ($check2['id'])){ $names .="<a href=http://links/?q=user&id={$names['id']}>$name</a>"; }else{ $names .="$name"; } Edited September 27, 2009 by cunamiX Quote Link to comment Share on other sites More sharing options...
homers Posted September 27, 2009 Author Report Share Posted September 27, 2009 EdgarsA jau palidzeja, paldies visiem 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.