hi my friends i got error in read pms and pop ups can some one tell me whats wrong with the code please
THIS IS THE ERROR FOR READ PMS
AND THIS IS THE ERROR FOR READ POPUPS
THIS IS FOR WAPDESIRE V_2 SCRIPT
thanks to any one that can help me fix this problem
Code:
READ PMS <?php define('WCS',true); include('../core/main.inc'); header_type(); cleardata(); if(ipbanned(ip(),browser())){ if(!shield(getuid_sid($sid))){ echo head_tag("Ip Blocked!!!",0,0); echo ipbanned_msg(); echo foot_tag(); exit(); } } if(!islogged($sid)){ echo head_tag("Error!!!",0,0); echo session_expired(); echo foot_tag(); exit(); } if(banned(getuid_sid($sid))){ echo head_tag("Error!!!",1,getnick_sid($sid)); echo banned_msg($sid); echo foot_tag(); exit(); } if(inboxbanned(getuid_sid($sid))){ echo head_tag("Error!!!",1,getnick_sid($sid)); echo inboxbanned_msg($sid); echo foot_tag(); exit(); } if($pass!=""){$pw="&pass=$pass";} if($rid!=""){ $rooms=mysql_fetch_array(mysql_query("SELECT id, name FROM chatrooms WHERE id='".$rid."'")); $rname=$rooms[1]; $chatlink="&rid=$rid$pw"; } mysql_query("UPDATE users SET browser='".browser()."', ipaddress='".ip()."', host='".subno()."' WHERE id='".getuid_sid($sid)."'"); ///////////////////////////////////////////////////////////////////////////////////// addonline(getuid_sid($sid),"Admin Tools",""); echo head_tag(getnick_sid($sid)."@Admin Tools",1,getnick_sid($sid)); $title="<b>Admin Tools</b>"; $main="<p align=".align().">\n"; $level=mysql_fetch_array(mysql_query("SELECT level FROM users WHERE id='".getuid_sid($sid)."'")); if($level[0]>4){ $uid = getuid_sid($sid); if($page=="" || $page<=0)$page=1; $myid = getuid_sid($sid); $pms = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM inbox WHERE byid=$who AND toid=$uid) ORDER BY timesent")); echo mysql_error(); $num_items = $pms[0]; //changable $items_per_page= 10; $num_pages = ceil($num_items/$items_per_page); if($page>$num_pages)$page= $num_pages; $limit_start = ($page-1)*$items_per_page; if($num_items>0) { $pms = mysql_query("SELECT byid, toid, text, timesent FROM inbox WHERE byid=$who ORDER BY timesent LIMIT $limit_start, $items_per_page"); while($pm=mysql_fetch_array($pms)) { if(isonline($pm[0])) { $onlby = "<img src=\"../phpThumb/phpThumb.php?src=../images/onl.gif\" alt=\"+\"/>"; }else{ $onlby = "<img src=\"../phpThumb/phpThumb.php?src=../images/ofl.gif\" alt=\"-\"/>"; } if(isonline($pm[1])) { $onlto = "<img src=\"../phpThumb/phpThumb.php?src=../images/onl.gif\" alt=\"+\"/>"; }else{ $onlto = "<img src=\"../phpThumb/phpThumb.php?src=../images/ofl.gif\" alt=\"-\"/>"; } $bylnk = "<a href=\"../profile.php?who=$pm[0]&sid=$sid\">$onlby".getnick_uid($pm[0])."</a>"; $tolnk = "<a href=\"../profile.php?who=$pm[1]&sid=$sid\">$onlto".getnick_uid($pm[1])."</a>"; $main.="$bylnk <img src=\"../phpThumb/phpThumb.php?src=../images/in.gif\" alt=\"-\"/> $tolnk"; $tmopm = date("d m y - h:i:s",$pm[3]); $main.=" $tmopm<br/>"; $pmtext=getbbcode($pm[2],$sid,1); $main.=$pmtext; $main.="<br/>--------------<br/>"; } $main.="</p><p align=\"center\">"; if($page>1) { $ppage = $page-1; $main.="<a href=\"readpms.php?type=tools&page=$ppage&sid=$sid&who=$who\">«Prev</a> "; } if($page<$num_pages) { $npage = $page+1; $main.="<a href=\"readpms.php?type=tools&page=$npage&sid=$sid&who=$who\">Next»</a>"; }} if($num_pages<1){ $main.="<p align=\"center\">"; $main.="<img src=\"../phpThumb/phpThumb.php?src=../images/error.gif\" alt=\"-\"/>"; $main.="Sorry No Pms Have Been Sent"; } if($num_pages>2) { $rets = "<form action=\"readpms.php\" method=\"get\">"; $rets .= "<input name=\"page\" style=\"-wap-input-format: '*N'\" size=\"2\"/>"; $rets .= "<input type=\"hidden\" name=\"action\" value=\"$action\">"; $rets .= "<input type=\"hidden\" name=\"sid\" value=\"$sid\">"; $rets .= "<input type=\"hidden\" name=\"who\" value=\"$who\">"; $rets .= "<input type=\"Submit\" name=\"Submit\" Value=\"Go To Page\"></form>"; $main.="$rets"; } $main.="<br/>$page/$num_pages<br/>"; $main.="<br/> $fivekey<a $key5 href=\"./tools.php?type=tools&sid=$sid\">Back</a> </p>\n"; }else{ addonline(getuid_sid($sid),"In The Forbidden Zone!",""); $main.="<img src=\"../images/error.gif\" alt=\"x\"/><br/>Permission Denied!<br/> <br/> $fivekey<a $key5 href=\"./tools.php?type=tools&sid=$sid\">Back</a> </p>\n"; } $L1="$sixkey<a $key6 href=\"../inbox/inbox.php?sid=$sid\">Inbox</a>"; $L2="$sevenkey<a $key7 href=\"../buds/buds.php?sid=$sid\">BuddyList</a>"; $L3="$eightkey<a $key8 href=\"../chat/public.php?sid=$sid\">Chat</a>"; $L4="$ninekey<a $key9 href=\"../forums/forums.php?sid=$sid\">Forums</a>"; $L5="$zerokey<a $key0 href=\"../main.php?sid=$sid\"><img src=\"../images/home.gif\" alt=\"\"/>Main Menu</a>"; echo xhtml($sid,$title,1,$L1,$L2,$L3,$L4,$L5,0,0,0,$main); ?>
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/spiceywa/public_html/admin/readpms.php on line 52
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'AND toid=2) ORDER BY timesent' at line 1
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'AND toid=2) ORDER BY timesent' at line 1
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/spiceywa/public_html/admin/readpopups.php on line 39
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'ORDER BY timesent' at line 1
-
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'ORDER BY timesent' at line 1
-
Code:
READ POP UPS <?php define('WCS',true); include('../core/main.inc'); header_type(); cleardata(); if(ipbanned(ip(),browser())){ if(!shield(getuid_sid($sid))){ echo head_tag("Ip Blocked!!!",0,0); echo ipbanned_msg(); echo foot_tag(); exit(); } } if(!islogged($sid)){ echo head_tag("Error!!!",0,0); echo session_expired(); echo foot_tag(); exit(); } if(banned(getuid_sid($sid))){ echo head_tag("Error!!!",1,getnick_sid($sid)); echo banned_msg($sid); echo foot_tag(); exit(); } mysql_query("UPDATE users SET browser='".browser()."', ipaddress='".ip()."', host='".subno()."' WHERE id='".getuid_sid($sid)."'"); addonline(getuid_sid($sid),"Admin Tools",""); echo head_tag(getnick_sid($sid)."@Admin Tools",1,getnick_sid($sid)); $title="<b>Admin Tools</b>"; $main="<p align=".align().">\n"; $level=mysql_fetch_array(mysql_query("SELECT level FROM users WHERE id='".getuid_sid($sid)."'")); if($level[0]>4){ $uid = getuid_sid($sid); if($page=="" || $page<=0)$page=1; $myid = getuid_sid($sid); $pms = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM popups WHERE byid=$who ORDER BY timesent")); echo mysql_error(); $num_items = $pms[0]; //changable $items_per_page= 10; $num_pages = ceil($num_items/$items_per_page); if($page>$num_pages)$page= $num_pages; $limit_start = ($page-1)*$items_per_page; if($num_items>0) { $pms = mysql_query("SELECT byid, toid, text, timesent FROM popups WHERE byid=$who ORDER BY timesent LIMIT $limit_start, $items_per_page"); while($pm=mysql_fetch_array($pms)) { if(isonline($pm[0])) { $onlby = "<img src=\"../phpThumb/phpThumb.php?src=../images/onl.gif\" alt=\"+\"/>"; }else{ $onlby = "<img src=\"../phpThumb/phpThumb.php?src=../images/ofl.gif\" alt=\"-\"/>"; } if(isonline($pm[1])) { $onlto = "<img src=\"../phpThumb/phpThumb.php?src=../images/onl.gif\" alt=\"+\"/>"; }else{ $onlto = "<img src=\"../phpThumb/phpThumb.php?src=../images/ofl.gif\" alt=\"-\"/>"; } $bylnk = "<a href=\"../profile.php?who=$pm[0]&sid=$sid\">$onlby".getnick_uid($pm[0])."</a>"; $tolnk = "<a href=\"../profile.php?who=$pm[1]&sid=$sid\">$onlto".getnick_uid($pm[1])."</a>"; $main.="$bylnk <img src=\"../phpThumb/phpThumb.php?src=../images/in.gif\" alt=\"-\"/> $tolnk"; $tmopm = date("d m y - h:i:s",$pm[3]); $main.=" $tmopm<br/>"; $pmtext=getbbcode($pm[2],$sid,1); $main.=$pmtext; $main.="<br/>--------------<br/>"; } $main.="</p><p align=\"center\">"; if($page>1) { $ppage = $page-1; $main.="<a href=\"readpopups.php?type=tools&page=$ppage&sid=$sid&who=$who\">«Prev</a> "; } if($page<$num_pages) { $npage = $page+1; $main.="<a href=\"readpopups.php?type=tools&page=$npage&sid=$sid&who=$who\">Next»</a>"; }} if($num_pages<1){ $main.="<p align=\"center\">"; $main.="<img src=\"../phpThumb/phpThumb.php?src=../images/error.gif\" alt=\"-\"/>"; $main.="Sorry No Pop ups Have Been Sent"; } if($num_pages>2) { $rets = "<form action=\"readpopups.php\" method=\"get\">"; $rets .= "<input name=\"page\" style=\"-wap-input-format: '*N'\" size=\"2\"/>"; $rets .= "<input type=\"hidden\" name=\"action\" value=\"$action\">"; $rets .= "<input type=\"hidden\" name=\"sid\" value=\"$sid\">"; $rets .= "<input type=\"hidden\" name=\"who\" value=\"$who\">"; $rets .= "<input type=\"Submit\" name=\"Submit\" Value=\"Go To Page\"></form>"; $main.="$rets"; } $main.="<br/>$page/$num_pages<br/>"; $main.="<br/> $fivekey<a $key5 href=\"./tools.php?type=tools&sid=$sid\">Back</a> </p>\n"; }else{ addonline(getuid_sid($sid),"In The Forbidden Zone!",""); $main.="<img src=\"../images/error.gif\" alt=\"x\"/><br/>Permission Denied!<br/> <br/> $fivekey<a $key5 href=\"./tools.php?type=tools&sid=$sid\">Back</a> </p>\n"; } $L1="$sixkey<a $key6 href=\"../inbox/inbox.php?sid=$sid\">Inbox</a>"; $L2="$sevenkey<a $key7 href=\"../buds/buds.php?sid=$sid\">BuddyList</a>"; $L3="$eightkey<a $key8 href=\"../chat/public.php?sid=$sid\">Chat</a>"; $L4="$ninekey<a $key9 href=\"../forums/forums.php?sid=$sid\">Forums</a>"; $L5="$zerokey<a $key0 href=\"../main.php?sid=$sid\"><img src=\"../images/home.gif\" alt=\"\"/>Main Menu</a>"; echo xhtml($sid,$title,1,$L1,$L2,$L3,$L4,$L5,0,0,0,$main); ?>
thanks to any one that can help me fix this problem
Comment