Jump to content
php.lv forumi

servera monitors


homers

Recommended Posts

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";
}

Link to comment
Share on other sites

<?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 by EdgarsA
Link to comment
Share on other sites

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 by cunamiX
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...