im getting this error into user's profile
and im using this code as view user
Code:
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/www/orkutwap.freehostia.com/web/index.php on line 2831
Code:
/////////////////////////////////viewuser profile else if($action=="viewuser") { addonline(getuid_sid($sid),"Viewing Users Profile","index.php?action=viewuser&who=$who"); echo "<head>"; echo "<title>View Profile</title>"; echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"../themes/$theme[0]\">"; echo "</head>"; echo "<body>"; echo mobads(); echo "<p align=\"center\">"; $lastloc=$_GET["lstloc"]; if($lastloc=="cht"){ $rid= $_GET["rid"]; $rooms = mysql_fetch_array(mysql_query("SELECT id, name FROM ibwf_rooms WHERE id='".$rid."'")); $rname = $rooms[1]; } if($who==""||$who==0) { $mnick = $_POST["mnick"]; $who = getuid_nick($mnick); } $whonick = getnick_uid($who); if($whonick!="") { if(isowner(getuid_sid($sid))) { echo "<a href=\"ownercp.php?action=user&sid=$sid&who=$who\">*Owner Tools*</a> "; } if(isheadadmin(getuid_sid($sid))) { echo "<a href=\"headadmincp.php?action=user&sid=$sid&who=$who\">*Head Admin Tools*</a> "; } if(ismod($uid)) { if(!isowner(getuid_sid($sid))) { if(!isheadadmin(getuid_sid($sid))) { echo "<a href=\"admincp.php?action=user&sid=$sid&who=$who\">*Admin Tools*</a> "; } } } $avlink = getavatar($who); if($avlink=="") { echo ""; }else{ echo "<img src=\"$avlink\" alt=\"$whonick\"/> "; } if(cansee(getuid_sid($sid), $who)) { $unol = mysql_fetch_array(mysql_query("SELECT lastpnreas FROM ibwf_users WHERE id='".$who."'")); /*if($unol[0]!="") { echo "Last Penalty Reason: $unol[0] "; } $unol = mysql_fetch_array(mysql_query("SELECT lastplreas FROM ibwf_users WHERE id='".$who."'")); if($unol[0]!="") { echo "Last Plusses Reason: $unol[0] "; }*/ } echo "[b]Username:[/b] $whonick "; echo "[b]Status:[/b] ".getstatus($who)." "; $nopl = mysql_fetch_array(mysql_query("SELECT regdate FROM ibwf_users WHERE id='".$who."'")); echo "[b]UserId:[/b] $who "; $nopl = mysql_fetch_array(mysql_query("SELECT sex, birthday, location FROM ibwf_users WHERE id='".$who."'")); $uage = getage($nopl[1]); if($nopl[0]=='M') { $usex = "Male"; }else if($nopl[0]=='F'){ $usex = "Female"; }else{ $usex = "Argh! No Profile!"; } $nopl[2] = htmlspecialchars($nopl[2]); echo "[b]Asl:[/b] $uage/$usex/$nopl[2] "; $nopl = mysql_fetch_array(mysql_query("SELECT regdate FROM ibwf_users WHERE id='".$who."'")); $jdt = date("H:i - D jS M y",$nopl[0]); echo "[b]Joined:[/b] $jdt "; $membrage = time() - $nopl[0]; $membrage = gettimemsg($membrage); echo "[b]Member For:[/b] $membrage "; $nob = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_buddies WHERE (uid='".$who."' OR tid='".$who."') AND agreed='1'")); echo "[b]Buddies:[/b] $nob[0] "; $nopl = mysql_fetch_array(mysql_query("SELECT email FROM ibwf_users WHERE id='".$who."'")); echo "[b]E-mail:[/b] $nopl[0] "; $nopl = mysql_fetch_array(mysql_query("SELECT refer FROM ibwf_users WHERE id='".$who."'")); echo "[b]Referal User:[/b] $nopl[0] "; $nopl = mysql_fetch_array(mysql_query("SELECT signature FROM ibwf_users WHERE id='".$who."'")); $sign = parsepm($nopl[0], $sid); echo "[b]Info:[/b] $sign "; $noi = mysql_fetch_array(mysql_query("SELECT lastact FROM ibwf_users WHERE id='".$who."'")); $var1 = date("His",$noi[0]); $var2 = time(); $var21 = date("His",$var2); $var3 = $var21 - $var1; $var4 = date("s",$var3); echo "[b]Idle For:[/b] "; $remain = time() - $noi[0]; $idle = gettimemsg($remain); echo "$idle "; $nopl = mysql_fetch_array(mysql_query("SELECT browserm FROM ibwf_users WHERE id='".$who."'")); echo "[b]Browser:[/b] $nopl[0] "; if(ismod(getuid_sid($sid))) { $uipadd = mysql_fetch_array(mysql_query("SELECT ipadd FROM ibwf_users WHERE id='".$who."'")); echo "[b]Ip:[/b] <a href=\"lists.php?action=byip&sid=$sid&who=$who\">$uipadd[0]</a> "; } $sql= mysql_fetch_array(mysql_query("SELECT profileview FROM ibwf_users WHERE id='".$who."'")); if ($who==$uid) { $sql1 = $sql[0]; } else { $sql1 = $sql[0]+1; } mysql_query("UPDATE ibwf_users SET profileview='".$sql1."' WHERE id='".$who."'"); $sql2=mysql_fetch_array( mysql_query("SELECT profileview FROM ibwf_users WHERE id='".$who."'")); echo "Profile viewed $sql2[0] times "; $sql = mysql_fetch_array(mysql_query("SELECT COUNT(id) FROM lastview WHERE whonick='".$whonick."'")); if ($sql[0]>10) { $sql = mysql_fetch_array(mysql_query("SELECT MAX(id) FROM lastview WHERE whonick='".$whonick."'")); $sql = $sql[0]-9; mysql_query("DELETE FROM lastview WHERE whonick='".$whonick."' AND id <'".$sql."'"); } $lv=getnick_sid($sid); $a = getuid_nick($whonick); if($a!=$uid) { mysql_query("INSERT INTO lastview SET lastview='".$lv."', whonick='".$whonick."', ltime='".time()."'"); } $sql= mysql_fetch_array(mysql_query("SELECT lastview,ltime FROM lastview WHERE whonick='".$whonick."'ORDER BY ltime DESC LIMIT 1")); $a = getuid_nick($sql[0]); $link = "<a href=\"index.php?action=viewuser&sid=$sid&who=$a\">$sql[0]</a>"; echo "last viewed by $link -"; $newtime =$sql[1]+(0 *60 *60); echo date("D d M y - h:i:s a",$newtime); echo "<a href=\"index.php?action=10pv&who=$who&sid=$sid\">+</a> "; if(budres($uid, $who)==0) { echo "<a href=\"genproc.php?action=bud&who=$who&sid=$sid&todo=add\">Add Buddy</a> "; }else if(budres($uid, $who)==1) { echo "(Queued Buddy Request) "; }else if(budres($uid, $who)==2) { echo "<a href=\"genproc.php?action=bud&who=$who&sid=$sid&todo=del\">Del Buddy</a> "; } if (arebuds($uid, $who)) { echo "<a href=\"inbox.php?action=sendpopup&who=$who&sid=$sid\">Send Popup</a> "; } echo "<a href=\"inbox.php?action=sendpm&who=$who&sid=$sid\">Send Inbox</a> "; $ires = ignoreres($uid, $who); if($ires==1) { echo "<a href=\"genproc.php?action=ign&who=$who&sid=$sid&todo=add\">Ignore</a> "; } if(isignored($who, $uid)) { echo "<a href=\"genproc.php?action=ign&who=$who&sid=$sid&todo=del\">UnIgnore</a> "; } echo "<a href=\"index.php?action=prostats&who=$who&sid=$sid\">User Stats</a> "; echo "<a href=\"uinfo.php?who=$who&sid=$sid\">Advanced Profile</a> "; echo "<a href=\"../users?$whonick\">Personal Wap Site</a> "; $noi = mysql_fetch_array(mysql_query("SELECT pollid FROM ibwf_users WHERE id='".$who."'")); if($noi[0]>0) { echo "<a href=\"index.php?action=viewpl&who=$who&sid=$sid\">Poll</a> "; } $noi = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_blogs WHERE bowner='".$who."'")); if($noi[0]>0) { echo "<a href=\"lists.php?action=blogs&who=$who&sid=$sid\">Blogs($noi[0])</a> "; } $noi = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_vault WHERE uid='".$who."'")); if($noi[0]>0) { echo "<a href=\"lists.php?action=vault&who=$who&sid=$sid\">Vault($noi[0])</a> "; } $noi = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_gbook WHERE gbowner='".$who."'")); echo "<a href=\"lists.php?action=gbook&who=$who&sid=$sid\">Guestbook($noi[0])</a> "; $judg = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_judges WHERE uid='".getuid_sid($sid)."'")); echo "</p>"; echo "<p align=\"center\">"; }else{ echo "<img src=\"../images/notok.gif\" alt=\"X\"/> Member dos not exist "; } if($lastloc=="cht"){ echo "[b]5 [/b]<a accesskey=\"5\" href=\"chat.php?sid=$sid&rid=$rid\">Back to $rname</a> "; echo "[b]6 [/b]<a accesskey=\"6\" href=\"inbox.php?action=main&sid=$sid\">Inbox</a> "; echo "[b]7 [/b]<a accesskey=\"7\" href=\"lists.php?action=buds&sid=$sid\">BuddyList</a> "; echo "[b]8 [/b]<a accesskey=\"8\" href=\"index.php?action=chat&sid=$sid\">Chat</a> "; echo forumlink($sid,9); echo "[b]0 [/b]<a accesskey=\"0\" href=\"index.php?action=main&sid=$sid\"><img src=\"../images/home.gif\" alt=\"\"/>Home</a>"; echo "</p>"; echo "</body>"; }else{ echo "[b]6 [/b]<a accesskey=\"6\" href=\"inbox.php?action=main&sid=$sid\">Inbox</a> "; echo "[b]7 [/b]<a accesskey=\"7\" href=\"lists.php?action=buds&sid=$sid\">BuddyList</a> "; echo "[b]8 [/b]<a accesskey=\"8\" href=\"index.php?action=chat&sid=$sid\">Chat</a> "; echo forumlink($sid,9); echo "[b]0 [/b]<a accesskey=\"0\" href=\"index.php?action=main&sid=$sid\"><img src=\"../images/home.gif\" alt=\"\"/>Home</a>"; echo "</p>"; echo "</body>"; } }