 |
select ข้อมูลมาแล้วไม่แสดง ข้อมูลมาจากการ join table ครับ |
|
 |
|
|
 |
 |
|
Code (SQL)
select dd.* from (SELECT t1.id,t2.cus_id,t1.xd,t2.rate,t1.username FROM `tb_member`as t1 , schedule as t2
where t1.id=t2.cus_id and t1.id!=1 and t2.rate!=1 and remark not like('%1') ORDER BY RAND())as dd where xd !='1' limit 6
ลองรันใน phpmyadmin ดูยังครับ?
|
 |
 |
 |
 |
Date :
2014-03-09 21:08:05 |
By :
itpcc |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
รันแล้วครับ รันได้ครับ
|
 |
 |
 |
 |
Date :
2014-03-09 21:10:25 |
By :
lin2online |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ลองแล้วนะคับ แต่พอมาหน้าเว็บข้อมูลไม่แสดงครับ
|
 |
 |
 |
 |
Date :
2014-03-09 21:13:17 |
By :
lin2online |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
มีคำสั่ง mysql_connect แล้วยังครับ?
|
 |
 |
 |
 |
Date :
2014-03-09 21:18:24 |
By :
itpcc |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
มีแล้วครับ
Code (PHP)
$sql= "select * from (SELECT * FROM `tb_member` where id != 1 ORDER BY RAND() ) as dd where xc != '1' limit 6 ";
$result=mysql_db_query($db,$sql);
$count=mysql_num_rows($result);
while ($rec = mysql_fetch_array($result))
{
$id = $rec["id"];
$idx3[] = $rec["id"];
$idd2[]= $rec["username"];
$cc[$id][$j] = 3;
}
query นี้แสดงได้ปกติครับ
แต่อันนั้นทำไมไม่แสดง ผมงงมากครับ
|
 |
 |
 |
 |
Date :
2014-03-09 21:25:46 |
By :
lin2online |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
$count ได้ค่าเท่าไหร่ครับ (ตัวต้นกระทู้นะ)
|
 |
 |
 |
 |
Date :
2014-03-09 21:37:02 |
By :
itpcc |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ได้ 6 ครับ
|
 |
 |
 |
 |
Date :
2014-03-09 21:50:07 |
By :
lin2online |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
โทษทีครับ count แล้วได้ 1 ครับ
|
 |
 |
 |
 |
Date :
2014-03-09 22:37:18 |
By :
lin2online |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
|
|