проблем с mysql_fetch_array

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
Код:
<?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";?>
 

rainbowdio

Registered
Нямаш намерени резултати с този username

Първо проверявай дали имаш намерени резултати (с този ред в червено) и ако имаш тогава извеждай информацията

<?php
include "style.php";
$username = $_GET['u'];
$query = "SELECT * FROM users where username='$username'";
$result = mysql_query($query);

if(mysql_num_rows($result) > 0) {

$row=mysql_fetch_array($result);
$member=$row[username];
$mail=$row;
$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];

[color=red]} [/color]
?>
 

rainbowdio

Registered
Значи имаш някаква грешка в заявката! Виж дали се подава GET параметър, също така дали съществува такава колона в таблицата, дали името на таблицата е правилно и това:
$result = mysql_query($query)or die(mysql_error());
 

Pro_Lamer4e

Registered
така е, това се получава само когато в потребителското име има ' и някакъв др символ

това ми е в htaccess-а RewriteRule ^user/(.*) profile.php?&u=$1
 

nom3r1

Registered
Тоя код е яко омацан. Толкова цикли, толкова неподреден - нищо се не разбира..

Пробвай така:

страницата ще е отваряш така: faila.php?u=1, faila.php?u=2, faila.php?u=3

PHP:
<?php
include "style.php";
$u_id = (int)$_GET['u'];
$query = mysql_query("SELECT * FROM users where id='{$u_id}'") or die(mysql_error());
?>
         
<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(mysql_num_rows($query) > 0) {
$row = mysql_fetch_array($query);
$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'];
$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 
} else {
echo "Няма такъв потребител!";
}
?>

</div>
</div>
</div>

         






</div>
</div>
<?php include "style2.php";?>
 

Pro_Lamer4e

Registered
nom3r1 каза:
Тоя код е яко омацан. Толкова цикли, толкова неподреден - нищо се не разбира..

Пробвай така:

страницата ще е отваряш така: faila.php?u=1, faila.php?u=2, faila.php?u=3

PHP:
<?php
include "style.php";
$u_id = (int)$_GET['u'];
$query = mysql_query("SELECT * FROM users where id='{$u_id}'") or die(mysql_error());
?>
         
<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(mysql_num_rows($query) > 0) {
$row = mysql_fetch_array($query);
$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'];
$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 
} else {
echo "Няма такъв потребител!";
}
?>

</div>
</div>
</div>

         






</div>
</div>
<?php include "style2.php";?>

така работи няма ли начин да се направи да се отварят така /user/username ?
 

nom3r1

Registered
Ми промени си $_GET заявката, да взима потребителското име и мини $_GET през trim(strip_tags($_GET['username']));

Относно: user/username

Ползвай .htaccess

ЕДИТ: И заявката трябва да промениш, вместо да "търси" в `id` да бъде в `username` или както ти е колоната.
 

zoom13

Registered
И аз имам почти същия проблем..Дава ми проблем при логин-а:Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/a3542926/public_html/login.php on line 17
А това е кода:
<?php
ob_start();
?>
Âõîä<hr color='black' width='300' align='center' />
<table align="center"><FORM action="" method="POST">
<tr><td>Ïîòðåáèòåëñêî èìå:</td><td><input type="text" name="name"></td></tr>
<tr><td>Ïàðîëà:</td><td><input type="password" name="pass"></td></tr>
<tr><td></td><td><input type="submit" name="submit" value="Æåãà!"></td></tr>
</table></FORM>
<?php
if(isset($_POST['submit'])) {
if($_POST['name'] != NULL && $_POST['pass'] != NULL) {
$name = htmlspecialchars($_POST['name']);
$pass = md5($_POST['pass']);
$query = "SELECT * FROM users WHERE name = '$name' AND pass = '$pass'";
$do = mysql_query($query);
$row = mysql_fetch_array($do);
$admin = $row['level'];
if($name == $row['name'] && $pass == $row['pass']) {
session_register("name");
session_register("pass");
if($admin > 0) { session_register("admin"); }
echo "<meta http-equiv=refresh content=0;url=index.php?a=map>"; }}}
ob_end_flush();
?>
<p><b><font color=white>Ïðîáâàéòå äåìî àêàóíòà</b></p>
<p>Àêàóíò : demo</p>
<p>Ïàðîëà : demo</p>
Къде ми е грешката?
 

Горе