SELECT l.hcode,l.pcucode,l.house,l.vhid,p.pid,p.prename,p.fname,p.lname,p.birth,p.age,p.sex,p.cid,p.hosmain,h.offname1,h.moo,h.provname,h.ampurname,h.tambonname,h.vhidname
FROM ".$layer." AS l
INNER JOIN person AS p ON l.vhid=p.vhid AND l.house=p.house AND l.pcucode=p.pcucode
INNER JOIN hoffice AS h ON l.pcucode=h.off_id
WHERE p.vhid = "LENGTH"(".$fldValue.")-8 AND p.house = substr(".$fldValue.",1,"LENGTH"(".$fldValue.")-8)
แล้วมันขึ้น ว่า
Parse error: syntax error, unexpected T_STRING in
อ่ะครับ