Pro_Lamer4e
Registered
каде ми гершката защото на 6-ти ред ми дава грешка
Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in /opt/public_html/test/profile.php on line 6
Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in /opt/public_html/test/profile.php on line 6
Код:
<?php
include "style.php";
$username = $_GET['u'];
$query = "SELECT * FROM users where username='$username'";
$result = mysql_query($query);
$row=mysql_fetch_array($result);
$member=$row[username];
$mail=$row[email];
$skype=$row[skype];
$avatar=$row[avatar];
$opisanie=$row[opisanie];
$rank=$row[rank];
$god=$row[godini];
$grad = $row[grad];
$sex = $row[sex];
$points = $row[points];
$postove = $row[forumPosts];
?>
<div class="border titleBarPanel boxNews" id="box8">
<div class="containerHead">
<div class="containerIcon">
<a href="javascript: void(0)" onclick="openList('profile', { save:true })"><img src="/work/icon/minusS.png" id="news8Image" alt="" /></a>
</div>
<div class="containerContent">
<h3>Преглед на профил</h3>
</div>
</div>
<div class="container-1" id="profile">
<div class="content containerContent">
<?php if ($member == NULL) { echo "Няма такъв потребител!"; } else {
$username = $_GET['u'];
if(preg_match('/^[a-zA-Z0-9]$/', $username)) {
echo 'Името съдържа недупостими букви';
} else {
if(!$username ){
echo"Изберете Потребител!";
}
$rank=$row[rank];
if($rank == '1') { $rankstatus = 'brown';}
if($rank == '2') { $rankstatus = 'blue';}
if($rank == '3') { $rankstatus = '#FF0000';}
if($rank == '4') { $rankstatus = 'deepskyblue';}
if($rank == '5') { $rankstatus = '#157DEC';}
if($rank == '6') { $rankstatus = 'green';}
else { ?>
<center><table width="95%" border="0"><tbody><tr>
<td style="padding-left: 10px; font: 12px arial; color: #666;" class="Htable" colspan="2"> Потребител: <b><font color=<?php echo "$rankstatus";?>><?php echo $member; ?></b></font> <?php
$count = 0;
$time = time();
$res = mysql_query("SELECT * FROM users where username='$username' AND $time - status <= 300");
while($row2 = mysql_fetch_array($res))
{
$LastAdmLoginTime = $row2["status"];
}
if($LastAdmLoginTime==0 || $LastAdmLoginTime<($time-300))
{
echo ('<img src=/images/users/offline1.gif>');
$time = 0;
}
else
{
echo ('<img src=/images/users/online1.gif>');
}
?></td></tr>
<tr><td width="15%" rowspan="5" class="table"><a href="<?php echo $pach; ?>user/<?php echo $member; ?>" class="avatar"><img width="127px" height="127px" src="<?php
echo $avatar;
?>"></a></td></tr>
<tr><td style="padding-left: 10px; font: 12px arial; color: #666;" class="table">Истинско име: <b><?php echo $row['yourname']; ?></b><br> Cs Nick: <b><?php echo $row['csnick']; ?></b></td></tr><tr><td style="padding-left: 10px; font: 12px arial; color: #666;" class="table"><img width="16" height="16" src="/images/email.gif"> Имейл Адрес: <b><i><a href="mailto:<?php echo $mail; ?>"><?php echo $mail; ?></a></i></b></td></tr><tr><td style="padding-left: 10px; font: 12px arial; color: #666;" class="table"><?php
if($rank == 1) {
echo '<img src="'.$pach.'/images/member.png">';
}
if($rank == 2) {
echo '<img src="'.$pach.'/images/moderator.png">';
}
if($rank == 3) {
echo '<img src="'.$pach.'/images/administrator.png">';
}
if($rank == 4) {
echo '<img src="'.$pach.'/images/vip.png">';
}
if($rank == 5) {
echo '<img src="'.$pach.'/images/vip.png">';
}
if($rank == 6) {
echo '<img src="'.$pach.'/images/vip.png">';
}
?></td></tr>
<tr><td style="padding-left: 10px; font: 12px arial; color: #666;" class="table" colspan="2">Регистриран на: <b><?php echo $row[date]; ?></b> </td></tr>
<tr><td style="padding-left: 10px; font: 12px arial; color: #666;" class="table" colspan="2"><a href="/sendls.php"><img width="16" height="16" src="/images/mail.gif"> Лично съощение </a><br></td></tr>
<tr><td style="padding-left: 10px; font: 12px arial; color: #666;" class="table" colspan="2"><img width="16" height="16" src="/images/years.png"> Години: <?php echo $god; ?></td></tr>
<tr><td style="padding-left: 10px; font: 12px arial; color: #666;" class="table" colspan="2"><img width="16" height="16" src="/images/kfm_home.png"> Местоположение: <b><?php
echo $grad;
?></b></td></tr>
<tr><td style="padding-left: 10px; font: 12px arial; color: #666;" class="table" colspan="2"><img width="16" height="16" src="/images/sex.png"> Пол: <b><?php echo $sex; ?></b></td></tr>
<tr><td style="padding-left: 10px; font: 12px arial; color: #666;" class="table" colspan="2"><img width="16" height="16" src="/images/icons/comment_bubble.png"> Мнения в форума: <b><font color=red><?php echo "$postove"?></font></b></td></tr>
<tr><td style="padding-left: 10px; font: 12px arial; color: #666;" class="table" colspan="2"><img width="16" height="16" src="/images/cs.png"> Добавени Сървъри: <b><font color=red>
<?php
$our = mysql_query("SELECT count(id) as id_total FROM servers WHERE author = '$member'");
while($r=mysql_fetch_array($our)){
echo $r['id_total'];
} ?><br></font></b></td></tr>
<tr><td style="padding-left: 10px; font: 12px arial; color: #666;" class="table" colspan="2"><img width="16" height="16" src="/images/alliedmods.png"> Качени плъгини: <b><font color=red>
<?php
$our = mysql_query("SELECT count(id) as id_total FROM files WHERE uploader = '$member'");
while($r=mysql_fetch_array($our)){
echo $r['id_total'];
} ?><br></font></b></td></tr>
<tr><td style="padding-left: 10px; font: 12px arial; color: #666;" class="table" colspan="2"><img width="16" height="16" src="/images/film.png"> Качени Клипове: <b><font color=red>
<?php
$our = mysql_query("SELECT count(id) as id_total FROM clips WHERE author = '$member'");
while($r=mysql_fetch_array($our)){
echo $r['id_total'];
} ?><br></font></b></td></tr>
<tr><td style="padding-left: 10px; font: 12px arial; color: #666;" class="table" colspan="2"><img width="16" height="16" src="/images/music.png"> Качени песни: <b><font color=red>
<?php
$our = mysql_query("SELECT count(id) as id_total FROM music WHERE author = '$member'");
while($r=mysql_fetch_array($our)){
echo $r['id_total'];
}} ?><br></font></b></td></tr>
<tr><td style="padding-left: 10px; font: 12px arial; color: #666;" class="table" colspan="2"><img width="16" height="16" src="templates/pearls.png"> Качени бисери: <b>25</b></td></tr>
<tr><td style="padding-left: 10px; font: 12px arial; color: #666;" class="table" colspan="2"><img width="16" height="16" src="templates/pearls.png"> Общ брой точки: <b><img src="/images/points.png" border="0" title="Точки:"> <font color='red'><?php echo $row['points']; ?></font></b></td></tr>
<tr><td style="padding-left: 10px; font: 12px arial; color: #666;" class="table" colspan="2">
Скайп: <?php echo"<a href='skype:$row[skype]?chat'> <img src='http://mystatus.skype.com/smallicon/$row[skype]' border='0'></a>";?> <?php echo $skype; ?></td></tr><tr><td style=" font: 12px arial; color: #666; overflow-y:scroll;" class="table" colspan="2">
<div style="width: 100%; cursor: text;min-height: 70px; padding: 3px;"><div class="general_box row1">
<h3><b> Подпис:</h3></b><?php echo nl2br($opisanie); ?> </div></div></div></td></tr></tbody></table>
<?php } } ?>
</div>
</div>
</div>
</div>
</div>
<?php include "style2.php";?>