Hola gente, tengo el siguiente error en un archivo y no puedo arreglarlo, aver si me ayudan ustedes
Error: Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/metin2ar/public_html/members/itemshop/test_/default.php on line 355
Este es el script:
Código PHP:
<?php
session_start();
require_once("../conn.php");
mysql_select_db("player");
?>
<?php
function DeCode($string,$operation,$key='')
{
$key=md5($key);
$key_length=strlen($key);
$string=$operation=='D'?base64_decode($string):substr(md5($string.$key),0,8).$string;
$string_length=strlen($string);
$rndkey=$box=array();
$result='';
for($i=0;$i<=255;$i++)
{
$rndkey[$i]=ord($key[$i%$key_length]);
$box[$i]=$i;
}
for($j=$i=0;$i<256;$i++)
{
$j=($j+$box[$i]+$rndkey[$i])%256;
$tmp=$box[$i];
$box[$i]=$box[$j];
$box[$j]=$tmp;
}
for($a=$j=$i=0;$i<$string_length;$i++)
{
$a=($a+1)%256;
$j=($j+$box[$a])%256;
$tmp=$box[$a];
$box[$a]=$box[$j];
$box[$j]=$tmp;
$result.=chr(ord($string[$i])^($box[($box[$a]+$box[$j])%256]));
}
if($operation=='D')
{
if(substr($result,0,8)==substr(md5(substr($result,8).$key),0,8))
{
return substr($result,8);
}
else
{
return'';
}
}
else
{
return str_replace('=','',base64_encode($result));
}
}
?><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD><TITLE></TITLE>
<META http-equiv=Content-Type content="text/html; charset=big5">
<STYLE type=text/css>
td img {display: block;}body,td,th {
font-family: Tahoma, §ºÊ^;
font-size: 12px;
color: #333333;
}
body {
margin-left: 0px;
margin-top: 0px;
margin-right: 0px;
margin-bottom: 0px;
background-image: url(images/index_r6_c10.jpg);
background-repeat: repeat;
}
a:link {
color: #333333;
text-decoration: none;
}
a:visited {
text-decoration: none;
color: #333333;
}
a:hover {
text-decoration: underline;
color: #FF0000;
}
a:active {
text-decoration: none;
color: #FF0000;
}
.STYLE1 {
color: #FF0000;
font-weight: bold;
}
</STYLE>
<META content="MSHTML 6.00.6000.16788" name=GENERATOR></HEAD>
<BODY>
<TABLE width="586" border=0 align="center" cellPadding=0 cellSpacing=0>
<TBODY>
<TR>
<TD height=31><img src="img/headeris2.jpg" width="586" height="125"></TD>
</TR></TBODY></TABLE>
<TABLE width="586" height=250 border=0 align="center" cellPadding=0 cellSpacing=0>
<TBODY>
<TR>
<TD vAlign=top align=center>
<TABLE cellSpacing=0 cellPadding=0 width="96%" align=center border=0>
<TBODY>
<TR>
<TD height=30>
<HR><?php
$exec_class="select classid,classname from shop_class order by classid desc";
$result_class=mysql_query($exec_class);
while($rs_class=mysql_fetch_array($result_class)){
echo "<a href=\"?classid=".$rs_class["classid"]."&page=".$_GET['page']."\">".DeCode($rs_class["classname"],'D','daichao')."</a> </br>";
}
?><HR>
<?php
if(isset($_SESSION["UserID"]) && strlen($_SESSION["UserID"])>1){
shop();
}else{login();}
function login(){
?>
<table width="560" border="0" cellspacing="0" cellpadding="0">
<form id="Login" name="Login" method="post" action="Loginok.php">
<tr>
<td height="40" colspan="2" align="center"><p class="STYLE1">Dieses Itemshopscript funktioniert nur mit Mozilla Firefox <a href="http://www.mozilla.com" target="_blank">http://www.mozilla.com</a></br> Powered by <a href="http://www.elitepvpers.com/forum" target="_blank">Elitepvpers</a> </p></td>
</tr>
<tr>
<td height="24" colspan="2" align="center"><p><strong>Itemshop-Login</strong></p></td>
</tr>
<tr>
<td width="242" height="24" align="right">BenutzerID:</td>
<td width="318" height="24"><input name="userid" type="text" id="userid2" size="20" onkeyup="value=value.replace(/[^\w\.\/]/ig,'')" style="width:140px;" /></td>
</tr>
<tr>
<td height="24" align="right">Passwort:</td>
<td height="24"><input name="password" type="password" autocomplete="off" id="password2" size="20" onKeyUp="value=value.replace(/[^\w\.\/]/ig,'')" style="width:140px;" /></td>
</tr>
<tr>
<td height="24" colspan="2" align="center"><input type="submit" name="Submit" value="Bestaetigen" class="button">¡@
<input type="reset" name="Submit" value="Zuruecksetzen" class="button">
<input type="hidden" name="shop_login" value="login" /></td>
</tr></form>
</table>
<?php
}
function shop(){
echo "<div align='center'>Willkommen ".$_SESSION["UserID"]."</br>Du hast noch <span style='color:black;'> ".$_SESSION["cash"]." </span>Coins. </br><a href=\"Loginout.php\">Ausloggen</a> <a href='../ChangePSD.php'>Passwort aendern</a> <a href='enter/entermoney.php'>Konto aufladen</a></br></br><div>";
?>
<?php
$classid=$_GET["classid"];
if($classid<0 || $classid=="" || is_numeric($classid)==false){$classid=0;}
if($classid>0){
$exec="select count(*) from item_proto where vnum in (select vnum from item_proto_shop where classid=$classid)";
}else{
$exec="select count(*) from item_proto where vnum in (select vnum from item_proto_shop)";
}
mysql_query("set names gb2312 ");
mysql_query("set CHARACTER gb2312 ");
$result=mysql_query($exec);
$rs=mysql_fetch_array($result);
$num=$rs[0];
if(empty($_GET['page'])){
$page=0;
}else{
$page=$_GET['page'];
if($page<0)$page=0;
if($page>=ceil($num/16))$page=ceil($num/16)-1;
}
if($classid>0){
$exec="select item_proto.vnum,item_proto.gb2312name,item_proto_shop.img,item_proto_shop.prices,item_proto_shop.content from item_proto,item_proto_shop where item_proto.vnum =item_proto_shop.vnum and item_proto_shop.classid=$classid order by item_proto.vnum desc limit ".($page*16).",16";
}else{
$exec="select item_proto.vnum,item_proto.gb2312name,item_proto_shop.img,item_proto_shop.prices,item_proto_shop.content from item_proto,item_proto_shop where item_proto.vnum =item_proto_shop.vnum order by item_proto.vnum desc limit ".($page*16).",16";
}
$result=mysql_query($exec);
while($rs=mysql_fetch_array($result)){
$i+=1;
?>
<table width="100%" border="0" cellpadding="0" cellspacing="0" id="itemshop_table">
<tr>
<td width="85" rowspan="3" align="center">
<a href="http://www.forosdelweb.com/f18/admin/<?=urldecode($rs["img"])?>" target="_blank" title="ÂIÀ»¬d¬Ý¹Ï¤ù"><div style="margin:0px 10px 0px 10px;"><img src="http://www.forosdelweb.com/f18/admin/<?=urldecode($rs["img"])?>" border="0" height="70" width="70" /></div></a>
</td>
<td class="header" width="30%"><div align="left"><?=$rs["gb2312name"]?></div></td>
<td class="header" width="65%"><div align="left">Preis: <?=$rs["prices"]?> Coins</div></td>
</tr>
<tr>
<td height="46" colspan="2"><?=DeCode($rs["content"],'D','daichao');?></td>
</tr>
<tr>
<td colspan="2" align="right"><a href="player.php?id=<?=$rs["vnum"]?>" title="ɲ®æ¡G<?=$rs["prices"]?>¡AÂIÀ»ÁʶR" >Kaufen</a></td>
</tr>
</table>
<?
}
?>
</div>
</div>
<div style="clear:both;" align="center">
<a href="?classid=<?=$_GET["classid"]?>&page=0">Erste Seite</a>
<a href="?classid=<?=$_GET["classid"]?>&page=<?=($page-1)?>">Vorherige Seite</a>
<a href="?classid=<?=$_GET["classid"]?>&page=<?=($page+1)?>">Naechste Seite</a>
<a href="?classid=<?=$_GET["classid"]?>&page=<?=ceil($num/16)-1?>">Letzte Seite</a>
</div>
<?php
}
?>
</TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE>
</BODY></HTML>
Un saludo