Rumah > pembangunan bahagian belakang > tutorial php > 反复写入数据库之后,同样的查询语句却查询不出结果

反复写入数据库之后,同样的查询语句却查询不出结果

WBOY
Lepaskan: 2016-06-13 12:45:09
asal
772 orang telah melayarinya

重复写入数据库之后,同样的查询语句却查询不出结果

<br>
<?php <br />
<br>
set_time_limit(0); <br>
<br>
 $filepath=$_GET['uploadfile'];<br>
require_once '../conn.php';<br>
<br>
error_reporting(E_ALL ^ E_NOTICE); <br>
<br>
$line=0;<br>
$shipments=0;<br>
$i=0;<br>
$s=0;<br>
$f=0;<br>
<br>
$strSqla="SELECT MAX(number) FROM `sale_orders_restock`";  //查询sale_orders_restock表id字段最大值<br>
$querya = mysql_query($strSqla,$conn); <br>
$resultaa= mysql_fetch_row($querya);<br>
$maxnum=$resultaa[0];<br>
$maxnum++;<br>
<br>
<br>
$file = fopen($filepath,"r") or die("打开文件失败"); <br>
<br>
while (!feof($file)) { <br>
<br>
$buffer = fgets($file);<br>
<br>
if ($line0)<br>
{	<br>
<br>
<br>
$u=explode('	', trim($buffer));<br>
if(!empty($u[0])){<br>
  <br>
  <br>
 $sku=$u[10];<br>
<br>
 $sql_itemcode="SELECT * FROM `sku_rule` WHERE `sku` = '$sku'";<br>
$querya = mysql_query($sql_itemcode,$conn); <br>
$rs= mysql_fetch_array($querya);<br>
<br>
<br>
<br>
$jj_sku=$rs['item_code'];<br>
$delivery_areas=$rs['delivery_areas'];<br>
$zhanghao=$rs['account'];<br>
<br>
<br>
  <br>
$or_id=$u[0];<br>
$or_it_id=$u[1];<br>
$payments_date=$u[3];<br>
<br>
<br>
$buyer_email=$u[7];<br>
$buyer_name=mb_convert_encoding(addslashes($u[8]), 'UTF-8','utf-8, shft-jis, gbk');<br>
$buyer_phone=mb_convert_encoding(addslashes($u[9]), 'UTF-8','utf-8, shft-jis, gbk');<br>
<br>
<br>
$product_name=mb_convert_encoding(addslashes($u[11]), 'UTF-8','utf-8, shft-jis, gbk');<br>
$quantity=$u[12];<br>
<br>
$recipient_name=mb_convert_encoding(addslashes($u[16]), 'UTF-8','utf-8, shft-jis, gbk');<br>
$ship_address1=mb_convert_encoding(addslashes($u[17]), 'UTF-8','utf-8, shft-jis, gbk');<br>
$ship_address2=mb_convert_encoding(addslashes($u[18]), 'UTF-8','utf-8, shft-jis, gbk');<br>
$ship_address3=mb_convert_encoding(addslashes($u[19]), 'UTF-8','utf-8, shft-jis, gbk');<br>
<br>
<br>
$ship_city=mb_convert_encoding(addslashes($u[20]), 'UTF-8','utf-8, shft-jis, gbk');<br>
$ship_state=mb_convert_encoding(addslashes($u[21]), 'UTF-8','utf-8, shft-jis, gbk');<br>
$ship_postal=mb_convert_encoding(addslashes($u[22]), 'UTF-8','utf-8, shft-jis, gbk');<br>
$ship_country=mb_convert_encoding($u[23], 'UTF-8','utf-8, shft-jis, gbk');<br>
$cancel_order=0;<br>
$logistics_number="";<br>
$logistics_company="";<br>
<br>
<br>
$strSql_item="SELECT * FROM `jperp`.`1_item_codes` WHERE `item_code`='$jj_sku'"; <br>
$query_item = mysql_query($strSql_item,$conn); <br>
$rs=mysql_affected_rows();<br>
$kit=0;<br>
if($rs>1)<br>
{<br>
while($rs = mysql_fetch_array($query_item) ){<br>
$or_it="";<br>
$jj_sku=$rs['stock_id'];<br>
<br>
$item_quantity=$rs['quantity'];<br>
$quantity=$quantity*$item_quantity;<br>
<br>
if($kit>0){<br>
$or_it=$or_it_id.$kit;<br>
}<br>
else<br>
{<br>
$or_it=$or_it_id;<br>
}<br>
<br>
 $sql_sale=" INSERT INTO `amazon_erp`.`sale_orders_restock` (`number` ,`order_id` ,`order_item_id`,`shipments` ,`payments_date` ,`buyer_email` ,`buyer_name`,`buyer_phone_number`,`sku`,`jj_sku`,`product_name`,`quantity_purchased`,`recipient_name`,`ship_address_1`,`ship_address_2`,`ship_address_3`,`ship_state`,`ship_postal_code`,`ship_country`,`account`,`ship_city`,`cancel_order`,`delivery_areas`,`logistics_number`,`logistics_company`)VALUES ('$maxnum','$or_id','$or_it',  '$shipments', '$payments_date','$buyer_email', '$buyer_name','$buyer_phone','$sku' ,'$jj_sku', '$product_name', '$quantity', '$recipient_name', '$ship_address1', '$ship_address2','$ship_address3','$ship_state' , '$ship_postal', '$ship_country', '$zhanghao', '$ship_city','$cancel_order','$delivery_areas','$logistics_number','$logistics_company')"; <div class="clear">
                 
              
              
        
            </div>
Salin selepas log masuk
Label berkaitan:
sumber:php.cn
Kenyataan Laman Web ini
Kandungan artikel ini disumbangkan secara sukarela oleh netizen, dan hak cipta adalah milik pengarang asal. Laman web ini tidak memikul tanggungjawab undang-undang yang sepadan. Jika anda menemui sebarang kandungan yang disyaki plagiarisme atau pelanggaran, sila hubungi admin@php.cn
Tutorial Popular
Lagi>
Muat turun terkini
Lagi>
kesan web
Kod sumber laman web
Bahan laman web
Templat hujung hadapan