Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/mysql/63.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 警告:mysql\u fetch\u assoc():提供的参数不是C:\xampp中的有效mysql结果资源\_Php_Mysql - Fatal编程技术网

Php 警告:mysql\u fetch\u assoc():提供的参数不是C:\xampp中的有效mysql结果资源\

Php 警告:mysql\u fetch\u assoc():提供的参数不是C:\xampp中的有效mysql结果资源\,php,mysql,Php,Mysql,嗨,我正在使用一个管理面板,它工作正常,但当我去用户网站,如果有这个错误 警告:mysql\u fetch\u assoc:C:\xampp\htdocs\admin中提供的参数不是有效的mysql结果资源。。。。。。。。。。。在第188行,第二个错误在第128行 下面是php代码 <?php include("config.php"); ?> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"&g

嗨,我正在使用一个管理面板,它工作正常,但当我去用户网站,如果有这个错误 警告:mysql\u fetch\u assoc:C:\xampp\htdocs\admin中提供的参数不是有效的mysql结果资源。。。。。。。。。。。在第188行,第二个错误在第128行 下面是php代码

    <?php include("config.php"); ?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<TITLE>Admin panel</TITLE>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">


<STYLE type=text/css>
BODY {
            BACKGROUND-REPEAT: repeat; BACKGROUND-COLOR: #CCFFFF}
</STYLE>
<LINK href="index_files/induc.css" type=text/css rel=stylesheet>
<STYLE type=text/css>
.style1 {
            COLOR: #cc0000
}
#notice {
            Z-INDEX: 1; LEFT: 375px; WIDTH: 422px; POSITION: absolute; TOP: 201px; HEIGHT: 99px; BACKGROUND-COLOR: #ffffff
}
a:link {
            color: #FFFFFF;
            text-decoration: none;
}
a:visited {
            text-decoration: none;
            color: #FFFFFF;
}
a:hover {
            text-decoration: underline;
            color: #000000;
}
a:active {
            text-decoration: none;
            color: #FFFFFF;
}
.style2 {color: #FFFFFF}
.style3 {FONT-SIZE: 11px; FONT-FAMILY: Verdana, Arial, Helvetica, sans-serif; LETTER-SPACING: 0.02em; font-weight: bold;}
.style4 {FONT-SIZE: 11px; FONT-FAMILY: Verdana, Arial, Helvetica, sans-serif; LETTER-SPACING: 0.02em; font-weight: bold; color: #FFFFFF; }
.style5 {
            color: #0000FF;
            font-weight: bold;
}
.style6 {
            font-size: 16px;
            font-weight: bold;
}
.style7 {           color: #FFFFFF;
            font-family: Verdana;
            font-size: 11px;
            font-weight: normal;
            text-decoration: none;
}
</STYLE>


</HEAD>
<BODY leftMargin=0 topMargin=0 MARGINHEIGHT="0" MARGINWIDTH="0">
<TABLE cellSpacing=0 cellPadding=0 width=812 align=center bgColor=#ffffff
border=0>
  <TBODY>
  <TR>
    <TD width=21><IMG height=21 src="index_files/topcorner1.gif" width=21></TD>
    <TD background=index_files/up.gif>&nbsp;</TD>
    <TD width=21><IMG height=21 src="index_files/topcorner2.gif"
  width=21></TD></TR>
  <TR>
    <TD background=index_files/lside.gif>&nbsp;</TD>
    <TD>
      <TABLE cellSpacing=0 cellPadding=0 width=770 align=center bgColor=#ff6600
      border=0>
        <TBODY>
        <TR>
          <TD bgcolor="#3D7FEF">            <TABLE cellSpacing=0 cellPadding=0 width="100%" border=0>
            <TBODY>
              <TR>
                <TD width=205 bgColor=#9c9a9c><img height=132 alt=""
                  src="index_files/topbanne.jpg" width=205></TD>
                <TD vAlign=top width=565>
                  <TABLE cellSpacing=0 cellPadding=0 width="100%" border=0>
                    <TBODY>
                      <TR>
                        <TD bgColor=#3D7FEF><IMG height=100 alt=""
                        src="index_files/toprighte1.jpg" width=565></TD>
                      </TR>
                      <TR>
                        <TD background=index_files/backg_top.gif height=32>
                          <TABLE cellSpacing=0 cellPadding=0 width="100%"
border=0>
                            <TBODY>
                              <TR>
                                <TD width="70%">
                                  <MARQUEE class="redbod style1"
                              scrollDelay=150>
                                  Welcome to Main page
                                </MARQUEE></TD>
                                <TD class=forbody2 width="30%">
                                  <DIV align=center>
                                    <SCRIPT language=javascript
                              src="index_files/date.js"></SCRIPT>
                                </DIV></TD>
                              </TR>
                            </TBODY>
                        </TABLE></TD>
                      </TR>
                    </TBODY>
                </TABLE></TD>
              </TR>
            </TBODY>
          </TABLE></TD>
        </TR>
        <TR>
          <TD vAlign=top>
            <TABLE cellSpacing=0 cellPadding=0 width="100%" border=0>
              <TBODY>
              <TR>
                <TD vAlign=top width=205 bgColor=#3D7FEF>
                  <TABLE cellSpacing=0 cellPadding=0 width="100%" border=0>
                    <TBODY>
                    <TR>
                      <TD height=187 colspan="3" vAlign=top bgColor=#3D7FEF><TABLE cellSpacing=0 cellPadding=0 width=180
                        align=center border=0>
                        <TBODY>
                                                                        <?php
                                                                        $str="select * from content";
                                                                        //echo $str;
                                                                        $row=mysql_query($str);
                                                                        while($res=mysql_fetch_assoc($row))
                                                                        {
                                                                        ?>
                          <TR>
                            <TD class=button><DIV align=left>
                                                                                    <A class=link href="index.php?qs=cont_show&pageid=<?php echo $res["id"];?>"><?php echo $res["page_title"];?></A></DIV></TD>
                          </TR>
                                                                          <?php } ?>

                        </TBODY>
                      </TABLE></TD>
                    </TR>
                    <TR>
                      <TD colspan="3">&nbsp;</TD>
                    </TR>
                    <TR>
                      <TD width="22%">&nbsp;</TD>
                      <TD width="58%"><div align="center" class="redbod style2">Last updated </div></TD>
                      <TD width="20%">&nbsp;</TD>
                    </TR>
                    <TR>
                      <TD>&nbsp;</TD>
                      <TD><div align="center"><span class="style2">[<?php echo date("d-m-y"); ?></span><span class="style2">]</span></div></TD>
                      <TD>&nbsp;</TD>
                    </TR>
                    </TBODY></TABLE></TD>
                <TD vAlign=top bgcolor="#FFFFFF">
                  <TABLE cellSpacing=0 cellPadding=0 width="100%" border=0>
                    <TR>
                      <TD>
                                                              <table width="100%" height="759" border="0" cellpadding=" 0" cellspacing=" 0">
                <tr>
                  <td height="674" valign="top" bgcolor="#FFFFFF" style="padding-left:10px; padding-right:10px">
                                                  <table width="100%" border="0" cellspacing=" 0" cellpadding=" 0">
                                                   <?php
                                                                                    if($_REQUEST["qs"]=="cont_show")
                                                                                    {
                                                                                    $_SESSION["ses"]="1";
                                                                                                $cont="select * from content  where id='".$_GET["pageid"]."'";
                                                                                                //echo $cont;
                                                                                                //exit;
                                                                                                $cont_row=mysql_query($cont);
                                                                                                $cont_res=mysql_fetch_assoc($cont_row);

                                                                                    ?>
                      <tr>
                        <td valign="top">
                                                                        <?php
                                                                        echo "<font color='#3D7FEF'>"."<b>"."Site Map >".$cont_res["page_title"]."</b>"."<font>"."<br>"."<br>";
                                                                        echo $cont_res["details"];
                                                                        ?>                          </td>
                        </tr>
                                                                         <?php } ?>
                                                                          <?php
                                                                           if($_SESSION["ses"]=="")
                                                                                    {
                                                                                    $cont="select * from content  where id='1'";
                                                                                                //echo $cont;
                                                                                                //exit;
                                                                                                $cont_row=mysql_query($cont);
                                                                                                $cont_res=mysql_fetch_assoc($cont_row);

                                                                                    ?>
                                                                                    <TR>
                                                                                    <td>
                                                                                    <?php
                                                                                    echo "<font color='#4A2E0F'>"."<b>"."Site Map >".$cont_res["page_title"]."</b>"."<font>"."<br>"."<br>";
                                                                                    echo $cont_res["details"];
                                                                                    ?></td>
                                                                                      </TR>
                                                                                      <?php
                                                                                      }

                                                                                      ?>
                    </table>                      </td>
                </tr>
              </table>                        </TD></TR></TBODY></TABLE></TD>
              </TR></TBODY></TABLE></TD></TR>
        <TR bgColor=#ffffff>
          <TD bgColor=#3D7FEF height=25>&nbsp;</TD>
        </TR>
        <TR bgColor=#ffffff>
          <TD bgColor=#3D7FEF height=25>
            <DIV class=smallbluebold align=center></DIV></TD></TR>
        <TR bgColor=#ffffff>
          <TD bgColor=#3D7FEF>
            <TABLE cellSpacing=0 cellPadding=0 width="100%" border=0>
              <TBODY>
                <TR>
                  <TD vAlign=bottom align=left width=10><IMG height=10
                  src="index_files/cornerwhite_lower_left.gif" width=10></TD>
                  <TD bgcolor="#3D7FEF">
                    <DIV class=forbody2 align=center>
                      <DIV align=center></DIV>
                  </DIV></TD>
                  <TD vAlign=bottom align=right width=10><IMG height=10
                  src="index_files/cornerwhite_lower_right.gif"
              width=10></TD>
                </TR>
              </TBODY>
            </TABLE></TD>
        </TR></TBODY></TABLE></TD>
    <TD background=index_files/rside.gif>&nbsp;</TD></TR>
  <TR>
    <TD><IMG height=20 src="index_files/downcorner1.gif" width=21></TD>
    <TD background=index_files/down.gif>&nbsp;</TD>
<TD><IMG height=20 src="index_files/downcorner2.gif"
  width=21></TD></TR></TBODY></TABLE>
</BODY></HTML>

如何避免这个错误?或者如何更正它我删除了那些操作输出并破坏部分输出的行如何修复此错误代码中缺少的是与数据库的连接


根据中的指定,您必须具有已打开的连接才能使用mysql\u查询,而无需指定链接标识符。请参阅有关如何执行此操作的说明。

不再支持mysql_*函数,它们已不再维护,将来也将继续使用。您应该使用或更新您的代码,以确保将来项目的功能。还请注意,您的html是,正如user689所说,mysql_*函数作为PHP5.5被弃用-但是,如果您坚持使用现有代码库的旧PHP版本,您应该继续使用它们。正如示例中提到的,第一行包含到数据库的连接,所以问题不在于连接