注意:未定义的变量:第17行的C:\ Program Files(x86)\ EasyPHP-DevServer-14.1VC11 \ data \ localweb \ projects \ toppvp.php中的mysqli_query

时间:2015-04-26 10:53:06

标签: php html mysql

你好朋友我的php编辑有问题所以我的问题是:

Notice: Undefined variable: mysqli_query in C:\Program Files (x86)\EasyPHP-DevServer-14.1VC11\data\localweb\projects\toppvp.php on line 17

<?php

$db_user = "root";
$db_pass = "";
$db_name_gs = "l2jgs";
$db_name_ls = "l2jls";
$db_name_cs = "l2jcs";
$db_serv = "127.0.0.1";
$res = mysqli_connect ( $db_serv, $db_user, $db_pass ) or die ("Coudn't connect to [$db_serv]");
    $resdb = mysqli_select_db ( $res, $db_name_gs ) or die (mysqli_error("Cannot connect to Game Server"));
    $resdb = mysqli_select_db ( $res, $db_name_ls ) or die (mysqli_error("Cannot connect to Login Server"));
    $resdb = mysqli_select_db ( $res, $db_name_cs ) or die (mysqli_error("Cannot connect to Community Server"));
$res="select characters.char_name,characters.pvpkills,char_templates.ClassName,characters.online,characters.accesslevel from characters,char_templates where characters.classid=char_templates.Classid order by characters.pvpkills DESC LIMIT 20";
echo"<html><head></head><body bgcolor='#000000' style='color:rgb(200,200,200)'>";
echo "<table  border='2' align=center width=440>";
echo "<tr><th>Nr</th><th>Name</th><th>PvP Kills</th><th>Main class</th><th>Status</th></tr>\n";
if ($result=mysqli_query($res,$mysqli_query)or die("Bed Sql syntax")) {
  $nr=1;
while ($row=mysql_fetch_row($result)) {
     echo "<tr><td align=center>".$nr."</td>";
     $nr++;
    echo "<td align=center>".$row[0]."</td>";
    echo "<td align=center>".$row[1]."</td>";
    echo "<td align=center>".$row[2]."</td>";
    if($row[4]==0)
    {   
        if($row[3])
        {echo "<td align=center style='color:rgb(0,255,0)'>Online</td></tr>\n"; }
         else{echo "<td align=center style='color:rgb(255,0,0)'>Offline</td></tr>\n";}
    }
     else{echo "<td align=center style='color:rgb(255,0,0)'>Hidden</td></tr>\n";}
}
}else{ echo "<!-- SQL Error ".mysql_error()." -->";}

echo "</table></body></html>";


?>

搜索了2个小时找到解决方案,我在这个论坛上看到了同样的问题,但没有找到合适的问题:(

如果有人帮助我,我将不胜感激。

0 个答案:

没有答案