Mysql Update 查询在 chrome 中执行两次,但在 mozilla 中执行一次 [英] Mysql Update query is executing twice in chrome but once in mozilla

查看:50
本文介绍了Mysql Update 查询在 chrome 中执行两次,但在 mozilla 中执行一次的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我遇到了非常不同的问题,我写了一个查询,它应该在页面加载时只执行一次,但它在 chrome 中执行了两次.是否有任何机构对此问题有任何想法.

I'm having very different problem that i have written one query which should execute only once on page load but it is getting executed twice in chrome. Does any body have any idea regarding this issue.

我还检查了 this 链接,但它的对我没用.

I have also check this link but its of no use for me.

我的代码:

// $rowvo['od_qty']=10;

// $row_1['qty']=20;

$sql = "SELECT qty  FROM tbl_size WHERE size_id =".$rowvo['size_id'];

$result = dbQuery($sql);

$row_1    = dbFetchAssoc($result);

$pqty=$row_1['qty']-$rowvo['od_qty'];

echo "Total Quantity Available Before Diduction : ".$row_1['qty'];

echo "Sold Quantity : ".$rowvo['od_qty'];

echo "Remaining Quantity : $pqty";

$sql_qty="update tbl_size set `qty`=$pqty where `size_id`=".$rowvo['size_id'];

echo "$sql_qty<br>";

$result_qty=mysql_query($sql_qty) or die('Error : '.mysql_error());

echo "No of Rows Affected : ".mysql_affected_rows()."<br>".mysql_error(); // 1

Web 服务器上的错误日志:

Error Log on Webserver :

[Wed Oct 09 12:19:30 2013] [notice] cannot use a full URL in a 401 ErrorDocument directive --- ignoring!
[Wed Oct 09 12:19:32 2013] [notice] cannot use a full URL in a 401 ErrorDocument directive --- ignoring!
[Wed Oct 09 12:19:32 2013] [notice] cannot use a full URL in a 401 ErrorDocument directive --- ignoring!

推荐答案

多次执行同一个查询的问题是因为样式标签损坏

The issue of multiple execution of the same query is because of broken style tag

style='background-image:url()';

但我不明白上面的东西怎么会影响我的 php 代码??????

But i didn't understood how can above thing has impact on my php code??????

这篇关于Mysql Update 查询在 chrome 中执行两次,但在 mozilla 中执行一次的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆