$strSQL1 = "SELECT a.*,b.*,c.*,d.* FROM crulis1 a,liscreator b,lissubjecthead c,lisadmin d WHERE a.id_lis=b.id_lis and a.id_lis=c.id_lis and a.id_admin=d.id_admin and a.id_admin='$r[id_admin]' and (a.Tile like '%".$_GET['txtquery']."%')";
เปลี่ยนเป็น JOIN ตารางดีกว่ามั้ยครับ Code (PHP)
$strSQL1 = "SELECT * FROM crulis1 a LEFT JOIN liscreator b ON (a.id_lis=b.id_lis)
LEFT JOIN lissubjecthead c ON (a.id_lis=c.id_lis)
LEFT JOIN lisadmin d ON (a.id_admin=d.di_admin)
WHERE a.id_admin='$r[id_admin]' AND (a.Tile LIKE '%$_GET[txtquery]%'";
จาก คุณ time-price.com
error แบบนี้ครับ
Error Query [SELECT * FROM crulis1 a LEFT JOIN liscreator b ON (a.id_lis=b.id_lis) LEFT JOIN lissubjecthead c ON (a.id_lis=c.id_lis) LEFT JOIN lisadmin d ON (a.id_admin=d.di_admin) WHERE a.id_admin='2' AND a.Tile LIKE '%การ%']
SELECT*
FROM crulis1 a
LEFTJOIN liscreator b ON ( a.id_lis = b.id_lis )
LEFTJOIN lissubjecthead c ON ( a.id_lis = c.id_lis )
LEFTJOIN lisadmin d ON ( a.id_admin = d.di_admin )
WHERE a.id_admin ='2'
AND a.Tile LIKE'การ'
LIMIT 0 , 30
MySQL แสดง:
#1054 - Unknown column 'a.Tile' in 'where clause'
.......