Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
241 views
in Technique[技术] by (71.8m points)

php - Mysql Update query is executing twice in chrome but once in mozilla

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.

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

My Code :

// $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

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!
See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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

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

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


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...