Jump to content
php.lv forumi

Visi useri ir pa 3


forSilence

Recommended Posts

Taisu useru lapu, kad visu pabeidzu nokļuvu pie lista kur būs redzami visi lietotāji. Un saskāros ar problēmu. Man katru useri parāda 3 reizes. Un nezinu kā to labot.

 

Rekur skīns:tbwpod7ov2wwlgm24hb.png

 

Un rekur tieši tā koda daļa

 

 

else{
$query = mysql_query("SELECT * FROM `ibf_members`, `ibf_member_extra` ");
while($row = mysql_fetch_array($query)){
switch($row['avatar_type'])
{
case 'upload':
$avatar = "forums/uploads/". $row['avatar_location'];
break;
case 'url':
$avatar = $row['avatar_location'];
break;
default:
$avatar = "images/noavatar.png";
break;
}
echo '
<div id="video_list"><div class="video">
<table><tr>
<td><img src="'.$avatar.'" width="30" height="30" /></td>
<td><a href="?do=user&id='.$row['id'].'">'.$row['members_display_name'].'</a></td>
</tr></table></div></div>';

}
}

Jau iepriekš paldies

Link to comment
Share on other sites

Man neiet ši faila formāts.

http://viewer.zoho.com/docs/ldxwcb

Ja kādam par maz tad varu piedāvāt vienu konspektu vel :)

http://viewer.zoho.com/docs/rdb38d

Iesaku novlikt un ar notepad vai notepad++ lasit tad var saprast kas tur ir :)

Edited by Faks
Link to comment
Share on other sites

Nu man ir tagad šādi:

mysql_query("SELECT id,members_display_name,mgroup FROM ibf_members");

mysql_query("SELECT avatar_location,avatar_type FROM ibf_member_extra");

\

Un to visu apvienot ar vienu funkciju jeb JOIN.

Biku pameklēju pa skriptiem un atradu.

mysql_query("SELECT id,members_display_name,mgroup FROM ibf_members JOIN ibf_member_extra ON (avatar_location = avatar_type");

Bet man nesanāca, lūdzu pielabot, lai strādātu.

Link to comment
Share on other sites

echo mysql_error() pēc kverija un izlasi, kas pa vainu. Es liktu uz to, ka jāpieraksta trūkstošie tabulu nosaukumi pirms id, members_blablbla, mgroup, avatar_location utt. Mysql nav kristāla lode, kura parāda no kuras tabulas konkrētos kolonnu nosaukumus vēlies izvilkt, salīdzināt.

Edited by Val
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...