duan0504 2015-10-14 06:34
浏览 28

显示updata结果但updata结果的数据不适用于PHP

I have a web application in a server(1st server) , But i am inserting data with a php page which is kept in other server(2nd server) . I am updating sql value through 2nd server web page .while i run update query database is updating , even updating information is showing in 2nd server front end and data base . But application is running with previous value .

In the web application (front end admin panel) there is a button Name "Edit " , while i click on edit button without inserting any value , its update value at that time and working with the value which i have updated through 2nd server web page .

Edit button code (web applicatiion 1st server font end code)

<FORM action="aegateway.jsp" method="POST"  id='aeform' name='aeform' onSubmit="javascript:document.getElementById('submitbutton').disabled=true">
<input type="hidden" name="cookie" value="535359523575209555454557521795755555652554555575226556501345397543575443548154" />**
<input type="hidden" name="submitted" id="submitted" value="true" />
<input type='hidden' name='rk' value='189' />

<INPUT class='ibutton bwidth' type='submit' name='submitbutton' id='submitbutton' value='EDIT' />&nbsp;<br><br>
</FORM>

second server update query code :

$sql = "SELECT AVG(column_name) as column_name1st, column_name2nd FROM table_name WHERE column_name = '0122' && column_name1st > 0";
$result = $mysqli->query($sql);


     while($row = $result->fetch_assoc()) {
        $meanvalue = $row["column_name1st"];
     }
     if($column_name1st > 70){
         $mysqli->query("UPDATE table_name2 SET field_name_one='0', field_name_two='30' WHERE username='user_id'");
     }
     elseif($meanvalue < 60)
     {
         $mysqli->query("UPDATE table_name2 SET field_name_one='6', field_name_two='0' WHERE username='user_id'");
     }

Finally i wanna to update value from 2nd server php page , which will execute in the web application in 1st server . both server access i have but project is need to run php mysql effective script from 2nd server data base update successfully also show on 1st server page but programme runing on previous value, application is performing with previous value. I already successfully updated data from 2nd server just want to know how to execute pregramme which one run on current value which was updated from 2server

i have tried with commit function but not working :

$sql = "SELECT AVG(duration) as duration, clientrateprefix FROM cdr_$mytable WHERE clientrateprefix = '8801' && duration > 0";
$result = $mysqli->query($sql);


     while($row = $result->fetch_assoc()) {
        $meanduration = $row["duration"];
     }
     if($meanduration > 120){
         $mysqli->query("UPDATE tablename SET field_name='value', field_name='value' WHERE colum_name='user_id'");
     }
     elseif($meanduration < 60)
     {
         $mysqli->query("UPDATE tablename SET field_name='3', field_name_two='value' WHERE colum_name='user_id'");
     }
        
$mysqli->commit();

</div>
  • 写回答

1条回答 默认 最新

  • dsklzerpx64815631 2015-10-14 16:11
    关注

    Try for $mysqli->commit() at the end of code.

    评论

报告相同问题?

悬赏问题

  • ¥15 Vue3 大型图片数据拖动排序
  • ¥15 划分vlan后不通了
  • ¥15 GDI处理通道视频时总是带有白色锯齿
  • ¥20 用雷电模拟器安装百达屋apk一直闪退
  • ¥15 算能科技20240506咨询(拒绝大模型回答)
  • ¥15 自适应 AR 模型 参数估计Matlab程序
  • ¥100 角动量包络面如何用MATLAB绘制
  • ¥15 merge函数占用内存过大
  • ¥15 使用EMD去噪处理RML2016数据集时候的原理
  • ¥15 神经网络预测均方误差很小 但是图像上看着差别太大