if(isset($_SESSION['adminbra']) && $_SESSION['adminbra'] == TRUE){
if($_SERVER['REQUEST_METHOD'] == "POST"){
 $updtqry = "UPDATE bra
    SET
     bugtitle = '". mysql_real_escape_string($_POST['bugtitle']) ."',
     status = '". mysql_real_escape_string($_POST['bugstatus']) ."',
     bugdetails = '". mysql_real_escape_string($_POST['bugdetails'] ."'

    WHERE
     bugid = '". $_SESSION['braupdid'] ."'
    "; // Row 166
 if(!$res = mysql_query($updtqry))
 {
  echo 'Mysql error! Contact webmaster ASAP!<br/>';
 }
 elseif(mysql_affected_rows() == 0)
 {
  echo 'No updates where made!<br/>';
 }
 else
 {
  echo 'Updated.<br/>';
 }

}
else
{
 if(isset($_GET['id']) && is_numeric($_GET['id'])){
  $qry1 = "SELECT *
      FROM bra
      WHERE bugid = '". $_GET['id'] ."'
        ";
  $mysqlqry1 = mysql_query($qry1);
  if($mysqlqry1){
   if(mysql_num_rows($mysqlqry1) > 0){
    while($row1 = mysql_fetch_assoc($mysqlqry1)){
     $_SESSION['braupdid'] = $row1['bugid'];
     echo '<form action="bra.php?action=editbug" method="post">';
     echo 'Bug title: <input type="text" name="bugtitle" value="'. $row1['bugtitle'] .'"/><br/>';
     echo 'Bug status: <select name="bugstatus">';
     echo '<option value="0">Not fixed</option>';
     echo '<option value="1">Fixed</option>';
     echo '<option value="2">Nofix</option>';
     echo '</select><br/>';
     echo 'Details: <br/>';
     echo '<textarea cols="50" rows="5" name="bugdetails">'. $row1['bugdetails'] .'</textarea>';
     echo '<input type="submit" value="submit"/>';
    }
   }
   else
   {
    echo 'Invalid bug id.<br/>';
   }
  }
  else
  {
   echo 'Mysql query failed! Contact webmaster ASAP!<br/>';
  }
 }
 else
 {
  echo 'Please provide a valid bug id.<br/>';
 }
}
}
else
{
 echo '<a href="bra.php?action=adminlogin">Login</a> first.<br/>';
}


您好再次stackoverflow ...

我在此代码中出现错误:
解析错误:语法错误,意外的';'在C:\ data \ home \ EasyPHP5.2.10 \ www \ BRA-错误报告Admin \ bra.php在第166行

但是问题出在哪里呢?第166行位于$ updtqry之后。

最佳答案

mysql_real_escape_string($_POST['bugdetails']缺少)

关于php - 出乎意料的同时没有错吗?,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/4408052/

10-11 02:22