$sql = "select * from aspos $strSearch order by ass_id desc ";
$result = mysql_query($sql );
$num = mysql_num_rows($result);
$sql2 = "select * from aspos $strSearch order by ass_id desc limit $start,$limit ";
$result2 = mysql_query($sql2 );
$num2 = mysql_num_rows($result2);
for ( $i=1 ; $i<=$num2 ; $i++ ) {
$row = mysql_fetch_array($result2);
โค้ดที่ทำการลิงค์ไว้ให้แสดงแต่table ของstaus ไม่สามรถแสดงในasposได้ เนื่องจากยังไม่ได้joinกัน
ได้ใครสามรถแทรกคำสั่งให้ได้บอกด้วยค่ะ
อยาก mysql join tb ทำไงค่ะ ดูให้หน่อย
Moderator: mindphp, ผู้ดูแลกระดาน
- mindphp
- ผู้ดูแลระบบ MindPHP
- โพสต์: 41406
- ลงทะเบียนเมื่อ: 22/09/2008 6:18 pm
- ติดต่อ:
Re: อยาก mysql join tb ทำไงค่ะ ดูให้หน่อย
ติดตาม VDO: http://www.youtube.com/c/MindphpVideoman
ติดตาม FB: https://www.facebook.com/pages/MindphpC ... 9517401606
หมวดแชร์ความรู้: https://www.mindphp.com/forums/viewforum.php?f=29
รับอบรม และพัฒนาระบบ: https://www.mindphp.com/forums/viewtopic.php?f=6&t=2042
ติดตาม FB: https://www.facebook.com/pages/MindphpC ... 9517401606
หมวดแชร์ความรู้: https://www.mindphp.com/forums/viewforum.php?f=29
รับอบรม และพัฒนาระบบ: https://www.mindphp.com/forums/viewtopic.php?f=6&t=2042
Re: อยาก mysql join tb ทำไงค่ะ ดูให้หน่อย
สมมติ
table customer
customerid,code,name
table address
addressid,customerid,address
select c.code,c.name,a.address from customer c,address a where c.customerid=a.customerid
table customer
customerid,code,name
table address
addressid,customerid,address
select c.code,c.name,a.address from customer c,address a where c.customerid=a.customerid
-
- Similar Topics
- ตอบกลับ
- แสดง
- โพสต์ล่าสุด
-
-
โพสต์ใหม่ อัพเกรด Mysql Ubuntu จาก MySQL 5.5 เป็น MySQL 5.7
โดย mindphp » 12/06/2016 5:57 pm » ใน Linux - Web Server - 1 ตอบกลับ
- 3354 แสดง
-
โพสต์ล่าสุด โดย mindphp
12/06/2016 5:58 pm
-
-
-
โพสต์ใหม่ อยาก override หน้าสินค้าของ Mooziicart ต้องทำอย่างไร
โดย eange08 » 10/06/2021 11:19 am » ใน ปัญหาการใช้ MooZiiCart - 3 ตอบกลับ
- 750 แสดง
-
โพสต์ล่าสุด โดย eange08
10/06/2021 2:37 pm
-
-
-
โพสต์ใหม่ VisualStudio อยาก debug javascript/jquery
โดย jataz2 » 22/08/2014 9:04 am » ใน Programming - C/C++ & java & Python - 0 ตอบกลับ
- 1284 แสดง
-
โพสต์ล่าสุด โดย jataz2
22/08/2014 9:04 am
-
-
-
โพสต์ใหม่ วิธีแสดงคำสั่ง ที่กำลังทำงานอยู่ของ MySQL / MariaDB ด้วยคำสั่ง show process command mysql
โดย mindphp » 29/06/2021 5:53 am » ใน SQL Knowledge - 0 ตอบกลับ
- 3666 แสดง
-
โพสต์ล่าสุด โดย mindphp
29/06/2021 5:53 am
-
ผู้ใช้งานขณะนี้
สมาชิกกำลังดูบอร์ดนี้: ไม่มีสมาชิกใหม่ และบุคลทั่วไป 99