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,038

HOME > PHP > PHP Forum > ช่วยด้วยครับ!!!!!!!!!! ต้องใช้คำสั่งอารัยอ่ะครับ ถึงดึงสินค้าทั้งหมดของผู้ฝากขายคนที่1ออกมาแสดง


[PHP] ช่วยด้วยครับ!!!!!!!!!! ต้องใช้คำสั่งอารัยอ่ะครับ ถึงดึงสินค้าทั้งหมดของผู้ฝากขายคนที่1ออกมาแสดง

 
Topic : 115554



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



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



ต้องใช้คำสั่งอารัยอ่ะครับ ถึงดึงสินค้าทั้งหมดของผู้ฝากขายคนที่1ออกมาแสดง
id

Code (PHP)
001.<? @session_start(); @ob_start;
002.if($_SESSION["user_consign"] ==""){
003.echo "<script language='javascript'> alert ('กรุณากลับไปLoginก่อนถึงจะตั้งคำถามได้');</script>";
004.echo "<script language='javascript'> history.back(1);</script>";
005.exit();
006.}
007. 
008.//============ Start Session และทำการเรียก Function ติดต่อฐานข้อมูล
009.include"../connect.php";
010.?>
011.<head>
012.<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
013.<title>.::รายละเอียดข้อมูลสินค้า::.</title>
014.<style type="text/css">
015.<!--
016..style5 {
017.    color: #000000;
018.    font-weight: bold;
019.}
020..style6 {font-size: 14px}
021.a:link {
022.    text-decoration: none;
023.}
024.a:visited {
025.    text-decoration: none;
026.}
027.a:hover {
028.    text-decoration: underline;
029.}
030.a:active {
031.    text-decoration: none;
032.}
033.-->
034.</style>
035.</head>
036.<body>
037.      <table width="846" height="420" border="1" align="center" cellpadding="0" cellspacing="1">
038.        <tr>
039.           
040.          <td width="844" valign="top">
041.            <table width="894" height="27" border="1" align="center" cellpadding="0" cellspacing="0">
042.  <tr>
043.    <td valign="top"><div align="center">
044.<?
045.include"../connect.php";
046.$strSQL ="SELECT * FROM product INNER JOIN theconsignment ON product.id_consign = theconsignment.id_consign where id_pro='$_GET[id_pro]' ";
047.$objQuery = mysql_query($strSQL) or die ("Error Query [".$strSQL."]");
048.if(mysql_num_rows($objQuery)){
049.    while($row_select=mysql_fetch_array($objQuery)){
050.?>
051.<table width="283" height="23" border="0" cellpadding="0" cellspacing="0">
052.                <tr>
053.                  <td><div align="center">
054.                    <form name="form2" method="post" action="">
055.                      <span class="style5">
056.                    <input type="image" name="imageField3" id="imageField3" src="../image/Detail.gif">
057.                    ข้อมูลรถมอเตอร์ไซค์ของคุณ </span>
058.                      <span class="style5">
059.                      <input type="image" name="imageField4" id="imageField4" src="../image/Detail.gif">
060.                      </span>
061.                    </form>
062.                    </div></td>
063.                </tr>
064.            </table><div align="right" class="style6"> <a href="show_pro.php">กลับหน้าหลัก </a></div>
065.            </div></td>
066.  </tr>
067.</table>      
068.             
069. 
070.<table width="839" height="138" border="0" align="center" cellpadding="0" cellspacing="0">
071.  <tr>
072.    <td valign="top"><img src="../product/uploaded/<?php echo $row_select["image1_pro"];?>" width="163" height="163" border="0"></td>
073.    <td valign="top"><img src="../product/uploaded/<?php echo $row_select["image2_pro"];?>" width="163" height="163" border="0"></td>
074.    <td valign="top"><img src="../product/uploaded/<?php echo $row_select["image3_pro"];?>" width="163" height="163" border="0"></td>
075.    <td valign="top"><img src="../product/uploaded/<?php echo $row_select["image4_pro"];?>" width="163" height="163" border="0"></td>
076.    <td valign="top"><img src="../product/uploaded/<?php echo $row_select["image5_pro"];?>" width="163" height="163" border="0"></td>
077.  </tr>
078.</table>
079. 
080.<table width="491" height="223" border="1" align="center" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF"><font color="#000000">
081.  <tr>
082.    <td> <font color="#000000"><p align="center"><strong>รายละเอียดข้อมูลรถมอเตอร์ไซค์</strong></p>
083.      <table width="97%" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#CCCCCC">
084.    <tr>
085.          <td><font color="#000000"><strong>เลขที่การฝากขายสินค้า :</strong></td>
086.      <td><font color="#000000"><?=$_GET["id_pro"];?></td>
087.    </tr>
088.    <tr>
089.      <td width="47%"><font color="#000000"><strong>ยี่ห้อรถมอเตอร์ไซค์ :</strong></td>
090.      <td width="53%"><font color="#000000"><?php echo $row_select['brand_pro'] ; ?></td>
091.    </tr>
092.    <tr>
093.      <td><font color="#000000"><strong>รุ่นของรถ : </strong></td>
094.      <td><font color="#000000"><?php echo $row_select['generate_pro'] ; ?></td>
095.    </tr>
096.    <tr>
097.      <td><font color="#000000"><strong>ปีที่จดทะเบียน  :</strong></td>
098.      <td><font color="#000000"><?php echo $row_select['registyear_pro'] ; ?></td>
099.    </tr>
100.    <tr>
101.      <td><font color="#000000"><strong>สีรถ :</strong></td>
102.      <td><font color="#000000"><?php echo $row_select['color_pro'] ; ?></td>
103.    </tr>
104.    <tr>
105.      <td><font color="#000000"><strong>ราคาที่ต้องการขาย :</strong></td>
106.      <td><font color="#000000"><?php echo $row_select['price_pro'] ; ?></td>
107.    </tr>
108.     <tr>
109.      <td><font color="#000000"><strong>วันที่ฝากขาย :</strong></td>
110.      <td><font color="#000000"><?php echo $row_select['date_pro'] ; ?></td>
111.    </tr>
112.    <tr>
113.      <td><font color="#000000"><strong>สถานะการยืนยันการฝากขาย :</strong></td>
114.      <td><font color="#000000"> <?
115.          if($row_select["status_pro"]=="1")
116.          {
117.          echo "รอการยืนยัน";
118.          }
119.          else
120.          {
121.          echo "ยืนยันแล้ว";
122.          }
123.          ?></td>
124.    </tr>
125.      </table></td>
126.  </tr>
127.</table>
128.<?
129.}
130.}
131.?>
132.<center>
133.          </td>
134.        </tr>
135. 
136.    
137.</body>
138.</html>




Tag : PHP, MySQL

Move To Hilight (Stock) 
Send To Friend.Bookmark.
Date : 2015-04-01 16:27:15 By : newnot View : 745 Reply : 2
 

 

No. 1



โพสกระทู้ ( 9,590 )
บทความ ( 2 )



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


การใช้ inner join ต้องแน่ใจว่ามีข้อมูล ตรงกัน ทั้งสองตาราง อย่างน้อย 1 ชุด จาก on clause นะครับ
ไม่อย่างนั้น จะไม่มีข้อมูลออกมา

แต่ถ้าเป็น left join จะมีข้อมูลออกมาเสมอ จากตารางด้านซ้าย
ก็เลือกใช้งานตามความเหมาะสมนะครับ
แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2015-04-02 05:23:19 By : Chaidhanan
 

 

No. 2



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



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


อ่อครับ ขอบคุณมากครับ
แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2015-04-02 08:44:42 By : newnot
 

   

ค้นหาข้อมูล


   
 

แสดงความคิดเห็น
Re : ช่วยด้วยครับ!!!!!!!!!! ต้องใช้คำสั่งอารัยอ่ะครับ ถึงดึงสินค้าทั้งหมดของผู้ฝากขายคนที่1ออกมาแสดง
 
 
รายละเอียด
 
ตัวหนา ตัวเอียง ตัวขีดเส้นใต้ ตัวมีขีดกลาง| ตัวเรืองแสง ตัวมีเงา ตัวอักษรวิ่ง| จัดย่อหน้าอิสระ จัดย่อหน้าชิดซ้าย จัดย่อหน้ากึ่งกลาง จัดย่อหน้าชิดขวา| เส้นขวาง| ขนาดตัวอักษร แบบตัวอักษร
ใส่แฟลช ใส่รูป ใส่ไฮเปอร์ลิ้งค์ ใส่อีเมล์ ใส่ลิ้งค์ 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 (หรือล็อกอินเข้าระบบสมาชิกเพื่อไม่ต้องกรอก)





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