Php 获取为解析错误时出错:语法错误,意外的T_变量
这是我在Php 获取为解析错误时出错:语法错误,意外的T_变量,php,mysql,Php,Mysql,这是我在update.php文件中的代码: <?php if(isset($_REQUEST['arr'])) { if(isset($_REQUEST['var1'])) { if(isset($_REQUEST['var2'])) { if(isset($_REQUEST['var3'])) { if(isset($_REQUEST['var4']))
update.php
文件中的代码:
<?php
if(isset($_REQUEST['arr']))
{
if(isset($_REQUEST['var1']))
{
if(isset($_REQUEST['var2']))
{
if(isset($_REQUEST['var3']))
{
if(isset($_REQUEST['var4']))
{
if(isset($_REQUEST['var5']))
{
//echo $pid=$_REQUEST['var5'];exit;
$all_data=array();
$all_data=array_chunk($_REQUEST['arr'], 19);
foreach($all_data as $values)
{
//echo "inside loop";
$month=$_REQUEST['var1'];
$week=$_REQUEST['var2'];
$gtot_stu=$_REQUEST['var3'];
$gtot_otu=$_REQUEST['var4'];
$pid=$_REQUEST['var5']
//$sql_upd="update timesheet_entry set s_st=$values[0],s_ot=$values[1],m_st=$values[2],m_ot=$values[3],t_st=$values[4],t_ot=$values[5],w_st=$values[6],w_ot=$values[7],th_st=$values[8],th_ot=$values[9],f_st=$values[10],f_ot=$values[11],sa_st=$values[12],sa_ot=$values[13],job_code=$values[14],job_name='$values[15]',st_tot=$values[16],ot_tot=$values[17],pm='$values[18]',gtot_st=$gtot_stu,gtot_ot=$gtot_otu where id='143'";
// $sql_upd="update timesheet_entry set s_st=$values[0] where ='$pid'";
$sql_upd="update timesheet_entry set s_st=$values[0] where id='143'";
if(mysql_query($sql_upd))
{
echo "Updated..!";
}
else
{
echo "Updation failed";
}
} //foreach
} // var 5
}//var4
}//var3
} //var2
}//var1
} //if (arr)
?>
第27行没有分号<代码>$pid=$_请求['var5']代码>
$pid=$_REQUEST['var5']
到
此外,你为什么写了这么多的“如果”?你可以这样做
if(isset(PARAMS1) && isset(PARAMS2) && isset(PARAMS3) )
那更易读。必须有第行。也写下它。我想你在$pid=$\u REQUEST['var5']@ranakrunal9行结束后漏掉了分号。你应该在回答中写上:)谢谢!我错过了。但当我修正它后,当我点击更新按钮时,整个页面代码显示为一个警报!就像一些大错误。你能帮忙吗?在这里用html添加完整的代码,然后提交,这样很容易检查。谢谢。当我试图更新代码时,我得到了所有html页面内容的警告,就像一个错误。在这两者之间,有这么多的noice显示为-----注意:未定义的偏移量:2在C:\wamp\www\sceptre\u internal\update.php的第58行是$sql\u upd被写入了这个注意是什么:未定义的偏移量:2,注意:未定义的偏移量:3…等等?更新失败
(!)注意:第58行C:\wamp\www\sceptre\u internal\update.php中未定义的偏移量:2
$pid=$_REQUEST['var5'];
if(isset(PARAMS1) && isset(PARAMS2) && isset(PARAMS3) )