raksmart活动促销

分享

写回答

发帖

打开页面出现以下错误,请高手帮忙!谢谢!

国外虚拟主机 国外虚拟主机 8588 人阅读 | 11 人回复

发表于 2009-1-8 09:51:15 | 显示全部楼层 |阅读模式

打开页面出现以下错误
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/d866cn0/public_html/dyj1/config.php on line 118
Update ka_kithe Set kitm=0,kizt=0,kizm=0,kizm6=0,kigg=0,kiws=0,kilm=0,kisx=0,kibb=0,zfb=0 where id=

以下是页面源代码
<?
$result=mysql_query("select * from config order by id");
$row=mysql_fetch_array($result);
   $btm=$row['btm'];
   $ctm=$row['ctm'];
   $dtm=$row['dtm'];
   $btmdx=$row['btmdx'];
   $ctmdx=$row['ctmdx'];
   $dtmdx=$row['dtmdx'];
   $bzt=$row['bzt'];
   $czt=$row['czt'];
   $dzt=$row['dzt'];
   $bztdx=$row['bztdx'];
   $cztdx=$row['cztdx'];
   $dztdx=$row['dztdx'];
    $bzm=$row['bzm'];
   $czm=$row['czm'];
   $dzm=$row['dzm'];
   $bzmdx=$row['bzmdx'];
   $czmdx=$row['czmdx'];
   $dzmdx=$row['dzmdx'];
   $bth=$row['bth'];
   $cth=$row['cth'];
   $dth=$row['dth'];
   $bthdx=$row['bthdx'];
   $cthdx=$row['cthdx'];
   $dthdx=$row['dthdx'];
    $bzm6=$row['bzm6'];
   $czm6=$row['czm6'];
   $dzm6=$row['dzm6'];
    $bsx=$row['bsx'];
   $csx=$row['csx'];
   $dsx=$row['dsx'];
    $zhang=$row['zhang'];
    $bsx6=$row['bsx6'];
   $csx6=$row['csx6'];
   $dsx6=$row['dsx6'];
    $bsxp=$row['bsxp'];
   $csxp=$row['csxp'];
   $dsxp=$row['dsxp'];
    $bbb=$row['bbb'];
   $cbb=$row['cbb'];
   $dbb=$row['dbb'];
   $jifei=$row['jifei'];
   $youbian=$row['youbian'];
  

//生成订单
function randStr($len=12) {   
$chars='0123456789'; // characters to build the password from   
mt_srand((double)microtime()*1000000*getmypid()); // seed the random number generater (must be done)   
$password='';   
while(strlen($password)<$len)   
$password.=substr($chars,(mt_rand()%strlen($chars)),1);   
return $password;   
}  




$keykey=gethostbyaddr('127.0.0.1');
  
   $keyon="ka-".$keykey;
function ka_config($i){   
   $result=mysql_query("Select ID,webname,weburl,tm,tmdx,tmps,zm,zmdx,ggpz,sanimal,affice,fenb,haffice2,a1,a2,a3,a10,opwww From config Order By ID Desc");
$ka_config1=mysql_fetch_array($result);
       
return $ka_config1[$i];
   }
   
   


$keym=md5($keyon);  
///  

function Get_sx_Color($rrr){   
$result=mysql_query("Select id,m_number,sx From ka_sxnumber where  m_number LIKE '%$rrr%'  and id<=12  Order By ID LIMIT 1");
$ka_Color1=mysql_fetch_array($result);
return $ka_Color1['sx'];
}





//if ($keym!=$zhang){
//echo"<script>top.location.href='reggo.php?id=ok';</script>";
//exit;
//}
  
///

function Get_bs_Color($i){   
   $result=mysql_query("Select ID,color From ka_color where id=".$i." Order By ID");
$ka_configg=mysql_fetch_array($result);
       
return $ka_configg['color'];
   }

function ka_Color_s($i){   
   $result=mysql_query("Select ID,color From ka_color where id=".$i." Order By ID");
$ka_configg=mysql_fetch_array($result);
        if ($ka_configg['color']=="r"){$bscolor="红波";}
        if ($ka_configg['color']=="b"){$bscolor="蓝波";}
        if ($ka_configg['color']=="g"){$bscolor="绿波";}
return $bscolor;
   }
   
   
   
  
///   
  
  $Current_Kithe_Num=1;
  $result=mysql_query("Select ID,NN,ND,NA,N1,N2,N3,N4,N5,N6,lx,kitm,kitm1,kizt,kizt1,kizm,kizm1,kizm6,kizm61,kigg,kigg1,kilm,kilm1,kisx,kisx1,kibb,kibb1,kiws,kiws1,zfb,zfbdate,zfbdate1,best From ka_Kithe where na=0 Order By ID Desc LIMIT 1");

$Current_KitheTable=mysql_fetch_array($result);



If ($Current_KitheTable[3]==0 Or $Current_KitheTable[4]==0 Or $Current_KitheTable[5]==0 Or $Current_KitheTable[6]==0 Or $Current_KitheTable[7]==0 Or $Current_KitheTable[8]==0 Or $Current_KitheTable[9]==0){
                $Current_Kithe_Num=$Current_KitheTable[1];
          }Else{
            $Current_Kithe_Num=$Current_KitheTable[1]+1;}



///
If ((strtotime($Current_KitheTable[30])-strtotime(date("Y-m-d H:i:s")))<=0){

$sql="Update ka_kithe Set kitm=0,kizt=0,kizm=0,kizm6=0,kigg=0,kiws=0,kilm=0,kisx=0,kibb=0,zfb=0 where id=$Current_KitheTable[0]";
$exe=mysql_query($sql) or die ($sql);


}



///
If ((strtotime($Current_KitheTable[31])-strtotime(date("Y-m-d H:i:s")))<=0){
if ($Current_KitheTable[32]==1){
$sql="Update ka_kithe Set kitm=1,kizt=1,kizm=1,kizm6=1,kigg=1,kiws=1,kilm=1,kisx=1,kibb=1,zfb=1,best=0 where id=$Current_KitheTable[0]";
$exe=mysql_query($sql) or die ($sql);}


}
//
if ($Current_KitheTable[29]==1){

If ((strtotime($Current_KitheTable[12])-strtotime(date("Y-m-d H:i:s")))<=0){
$sql="Update ka_kithe Set kitm=0 where id=$Current_KitheTable[0]";
$exe=mysql_query($sql) or die ($sql);
}

If ((strtotime($Current_KitheTable[14])-strtotime(date("Y-m-d H:i:s")))<=0){
$sql="Update ka_kithe Set kizt=0 where id=$Current_KitheTable[0]";
$exe=mysql_query($sql) or die ($sql);
}

If ((strtotime($Current_KitheTable[16])-strtotime(date("Y-m-d H:i:s")))<=0){
$sql="Update ka_kithe Set kizm=0 where id=$Current_KitheTable[0]";
$exe=mysql_query($sql) or die ($sql);
}

If ((strtotime($Current_KitheTable[18])-strtotime(date("Y-m-d H:i:s")))<=0){
$sql="Update ka_kithe Set kizm6=0 where id=$Current_KitheTable[0]";
$exe=mysql_query($sql) or die ($sql);
}

If ((strtotime($Current_KitheTable[20])-strtotime(date("Y-m-d H:i:s")))<=0){
$sql="Update ka_kithe Set kigg=0 where id=$Current_KitheTable[0]";
$exe=mysql_query($sql) or die ($sql);
}

If ((strtotime($Current_KitheTable[22])-strtotime(date("Y-m-d H:i:s")))<=0){
$sql="Update ka_kithe Set kilm=0 where id=$Current_KitheTable[0]";
$exe=mysql_query($sql) or die ($sql);
}
If ((strtotime($Current_KitheTable[24])-strtotime(date("Y-m-d H:i:s")))<=0){
$sql="Update ka_kithe Set kisx=0 where id=$Current_KitheTable[0]";
$exe=mysql_query($sql) or die ($sql);
}
If ((strtotime($Current_KitheTable[26])-strtotime(date("Y-m-d H:i:s")))<=0){
$sql="Update ka_kithe Set kibb=0 where id=$Current_KitheTable[0]";
$exe=mysql_query($sql) or die ($sql);
}



If ((strtotime($Current_KitheTable[28])-strtotime(date("Y-m-d H:i:s")))<=0){
$sql="Update ka_kithe Set kiws=0 where id=$Current_KitheTable[0]";
$exe=mysql_query($sql) or die ($sql);
}
}





?>

回答|共 11 个

一路同行

发表于 2009-1-8 10:08:19 | 显示全部楼层

错误提示应该是SQL语句有问题,无效的结果集

阳光宝贝

发表于 2009-1-10 18:01:23 | 显示全部楼层

但是为何在本机测试可以用了?

但是为何在本机测试可以用了?本机的操作系统是Windows XP
空间的操作系统是LINUX 是不是和这的关系了?

webghost

发表于 2009-1-10 20:40:00 | 显示全部楼层

是不是register globel没有打开,LP的默认是关好像,变量没有传过去,导致查询为空啊.

阳光宝贝

发表于 2009-1-11 16:59:03 | 显示全部楼层

那要怎么打开register globel了?谢谢

那要怎么打开register globel了?谢谢

webghost

发表于 2009-1-11 17:05:16 | 显示全部楼层

在网站的根目录下有一个PHP.ini文件,在里面加一句
register_globals = on

阳光宝贝

发表于 2009-1-11 17:10:34 | 显示全部楼层

谢谢,但好象和这个没关系!

谢谢,但好象和这个没关系!

webghost

发表于 2009-1-11 17:13:18 | 显示全部楼层

嗯,我PHP懂的也不多。

一路同行

发表于 2009-1-12 09:09:25 | 显示全部楼层

你用的是什么程序?在mysql_fetch_array()前面加一“@”符号看看

阳光宝贝

发表于 2009-1-12 10:37:05 | 显示全部楼层

在mysql_fetch_array()前面加一“@”符号

在mysql_fetch_array()前面加一“@”符号后出现下面错误
Update ka_kithe Set kitm=0,kizt=0,kizm=0,kizm6=0,kigg=0,kiws=0,kilm=0,kisx=0,kibb=0,zfb=0 where id=
您需要登录后才可以回帖 登录 | 注册

本版积分规则