Register Register Member Login Member Login Member Login Forgot Password ??
PHP , ASP , ASP.NET, VB.NET, C#, Java , jQuery , Android , iOS , Windows Phone
 

Registered : 109,027

HOME > PHP > PHP Forum > update ข้อมูลโดยมีเงื่อนไขวันที่ไม่ได้ครับ รบกวนหน่อยครับ



 

update ข้อมูลโดยมีเงื่อนไขวันที่ไม่ได้ครับ รบกวนหน่อยครับ

 



Topic : 123012



โพสกระทู้ ( 5 )
บทความ ( 0 )



สถานะออฟไลน์




คือผมจะ update ข้อมูลโดยมีเงื่อนไข update วันที่นี้ ถึง วันที่นี้ แต่มัน update ได้แต่วันที่ปัจจุบันอะครับ รบกวนหน่อยครับ
order
<form action="invoice.php" method="get">
							<table style="width:100%;" cellspacing="0" cellpadding="0">

								<tbody><tr style="height:20px;">
									<td colspan="3"></td>
								</tr>
                               <?
if($_GET["txtKeyword"] and $_GET["txtKeyword2"] != "")
	{
$meSql8 = "SELECT Product_Id,Band,Model,Cost_Price,Date_Pay ,sum(Order_qty) as Order_qty,sum(Cost_Total) as Cost_Total

FROM order_details

Where Date_Pay between '".$_GET['txtKeyword']."' and '".$_GET['txtKeyword2']."' and Status = 'ชำระแล้ว' 
GROUP BY Product_Id";
$meQuery8 = mysql_query($meSql8);
?>
								<tr style="">
									<td style="vertical-align:top;"><table class="table table-striped">
                <thead>
                    <tr>
                   		<th>วันที่</th>
                        <th>รหัสสินค้า</th>
                        <th>รายละเอียด</th>
                        <th>ราคาต่อหน่วย</th>
                        <th>จำนวน</th>
                        <th>จำนวนเงิน</th>
                    </tr>
                </thead>
                <tbody>
                    <?php
                    while ($meResult8 = mysql_fetch_assoc($meQuery8))
                    {
                        ?>
                        <tr>
                        <td><div align="center"><?php echo $meResult8['Date_Pay']; ?></div></td>
                            <td><div align="center"><?php echo $meResult8['Product_Id']; ?>
                           </div></td>
                            <td><?php echo $meResult8['Band']; ?> <?php echo $meResult8['Model']; ?></td>
                            <td><div align="right"><?php echo $meResult8['Cost_Price']; ?></div></td>
                            <td><div align="center"><?php echo $meResult8['Order_qty']; ?></div></td>
                            <td><div align="right"><?php echo number_format($meResult8['Cost_Total'],2); ?></div></td>
                        </tr>
                        <?php
                    }
                    ?>
                </tbody>
                <?php
	
}
?>
            </table>
               
            </td>
								</tr>

								<tr style="">
									<td><p>
									<div align="right">
                                      <table width="100%" border="0" align="right">
                                        <tr>
                                          <td width="30%"><select name="agent">
			<option value="">เลือตัวแทนจำหน่าย</option>
			<?php
			$strSQL5 = "SELECT * FROM agent";
			$objQuery5 = mysql_query($strSQL5);
			while($objResuut5 = mysql_fetch_array($objQuery5))
			{
			?>
			<option value="<?php echo $objResuut5["Name"];?>">
			<?php echo $objResuut5["Name"];?></option>
			<?php
			}
			?>
		  </select></td>
                                          <td width="50%"><div align="right"> <input name="" type="submit" value="สั่งซื้อ" /></div></td>
                                        </tr>
                                      </table>
                                     </td>
                                      
								</tr>
								<tr style="height:5px; ">
									<td colspan="3"></td>
								</tr>
							</tbody></table>
                            <input  type="hidden" name="numbermax" value="<?php echo $number_max;?>" />
                                  <input  type="hidden" name="status" value="<?php echo "สั่งซื้อแล้ว";?>" />
                                  <input  type="hidden" name="status2" value="<?php echo "เสร็จสิ้น";?>" />
                                  <input  type="hidden" name="date" value="<?=date("Y-m-d")?>" />
                                  <input  type="hidden" name="date1" value="<?php echo $_GET["txtKeyword"];?>" />
                                  <input  type="hidden" name="date2" value="<?php echo $_GET["txtKeyword2"];?>" />
                                  <input  type="hidden" name="status3" value="<?php echo "ชำระแล้ว";?>" />
</form>



invoice
<?
if($_POST['date'] and $_POST['date2'] != "")
	{
		echo "กรุณาใส่ข้อมูล!";
		exit();
	}
?>
<?
$sql_edit = "update order_details 
	set 
Status = '$status2',
Agent = '$status',
Invoice_Id = '$numbermax',
Date_Invoice = '$date',
Agent_Name = '$agent' 
where Date_Pay between '$date' and '$date2' and Status = 'ชำระแล้ว'"; 
	mysql_query($sql_edit) or die(mysql_error());
	
	$sql_edit2 = "update order_list 
	set 
Status = '$status2',
Agent = '$status',
Invoice_Id = '$numbermax',
Date_Invoice = '$date',
Agent_Name = '$agent' 
where Date_Pay between '$date' and '$date2' and Status = 'ชำระแล้ว'"; 
	mysql_query($sql_edit2) or die(mysql_error());
?>




Tag : PHP, MySQL







Move To Hilight (Stock) 
Send To Friend.Bookmark.
Date : 2016-05-20 15:24:23 By : allstarguitar View : 743 Reply : 2
 

 

No. 1



โพสกระทู้ ( 5 )
บทความ ( 0 )



สถานะออฟไลน์


ช่วยหน่อยครับ โปรเจคจบ ติดตรงนี้ไปต่อไม่ได้






แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2016-05-20 20:26:35 By : allstarguitar
 


 

No. 2



โพสกระทู้ ( 74,058 )
บทความ ( 838 )

สมาชิกที่ใส่เสื้อไทยครีเอท

สถานะออฟไลน์
Twitter Facebook

Code (PHP)
$sql_edit = "update order_details 
	set 
Status = '$status2',
Agent = '$status',
Invoice_Id = '$numbermax',
Date_Invoice = '$date',
Agent_Name = '$agent' 
where Date_Pay between '$date' and '$date2' and Status = 'ชำระแล้ว'"; 

echo $sql_edit;


เอาค่า SQL ออกมาดูหน่อยครับ Format ที่ถูกต้องจะต้องเป็น YYYY-MM-DD H:i:s ครับ
แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2016-05-23 09:53:38 By : mr.win
 

   

ค้นหาข้อมูล


   
 

แสดงความคิดเห็น
Re : update ข้อมูลโดยมีเงื่อนไขวันที่ไม่ได้ครับ รบกวนหน่อยครับ
 
 
รายละเอียด
 
ตัวหนา ตัวเอียง ตัวขีดเส้นใต้ ตัวมีขีดกลาง| ตัวเรืองแสง ตัวมีเงา ตัวอักษรวิ่ง| จัดย่อหน้าอิสระ จัดย่อหน้าชิดซ้าย จัดย่อหน้ากึ่งกลาง จัดย่อหน้าชิดขวา| เส้นขวาง| ขนาดตัวอักษร แบบตัวอักษร
ใส่แฟลช ใส่รูป ใส่ไฮเปอร์ลิ้งค์ ใส่อีเมล์ ใส่ลิ้งค์ FTP| ใส่แถวของตาราง ใส่คอลัมน์ตาราง| ตัวยก ตัวห้อย ตัวพิมพ์ดีด| ใส่โค้ด ใส่การอ้างถึงคำพูด| ใส่ลีสต์
smiley for :lol: smiley for :ken: smiley for :D smiley for :) smiley for ;) smiley for :eek: smiley for :geek: smiley for :roll: smiley for :erm: smiley for :cool: smiley for :blank: smiley for :idea: smiley for :ehh: smiley for :aargh: smiley for :evil:
Insert PHP Code
Insert ASP Code
Insert VB.NET Code Insert C#.NET Code Insert JavaScript Code Insert C#.NET Code
Insert Java Code
Insert Android Code
Insert Objective-C Code
Insert XML Code
Insert SQL Code
Insert Code
เพื่อความเรียบร้อยของข้อความ ควรจัดรูปแบบให้พอดีกับขนาดของหน้าจอ เพื่อง่ายต่อการอ่านและสบายตา และตรวจสอบภาษาไทยให้ถูกต้อง

อัพโหลดแทรกรูปภาพ

Notice

เพื่อความปลอดภัยของเว็บบอร์ด ไม่อนุญาติให้แทรก แท็ก [img]....[/img] โดยการอัพโหลดไฟล์รูปจากที่อื่น เช่นเว็บไซต์ ฟรีอัพโหลดต่าง ๆ
อัพโหลดแทรกรูปภาพ ให้ใช้บริการอัพโหลดไฟล์ของไทยครีเอท และตัดรูปภาพให้พอดีกับสกรีน เพื่อความโหลดเร็วและไฟล์ไม่ถูกลบทิ้ง

   
  เพื่อความปลอดภัยและการตรวจสอบ กระทู้ที่แทรกไฟล์อัพโหลดไฟล์จากที่อื่น อาจจะถูกลบทิ้ง
 
โดย
อีเมล์
บวกค่าให้ถูก
<= ตัวเลขฮินดูอารบิก เช่น 123 (หรือล็อกอินเข้าระบบสมาชิกเพื่อไม่ต้องกรอก)







Exchange: นำเข้าสินค้าจากจีน, Taobao, เฟอร์นิเจอร์, ของพรีเมี่ยม, ร่ม, ปากกา, power bank, แฟลชไดร์ฟ, กระบอกน้ำ

Load balance : Server 01
ThaiCreate.Com Logo
© www.ThaiCreate.Com. 2003-2024 All Rights Reserved.
ไทยครีเอทบริการ จัดทำดูแลแก้ไข Web Application ทุกรูปแบบ (PHP, .Net Application, VB.Net, C#)
[Conditions Privacy Statement] ติดต่อโฆษณา 081-987-6107 อัตราราคา คลิกที่นี่