0
我已經folllowing代碼來創建SQL查詢不能形成正確的字符串
$sql= '(SELECT ticket_id,message,created,2 from '.TICKET_MESSAGE_TABLE.' msg where msg.ticket_id ='.db_input($id).') UNION (SELECT ticket_id,response,created,1 from '.TICKET_RESPONSE_TABLE.' resp where resp.ticket_id= '.db_input($id).')UNION (SELECT ticket_id,note,created,3 FROM '.TICKET_NOTE-TABLE .' note WHERE note.ticket_id='.db_input($id).') order by created';
echo "sql: ".$sql;
我得到
sql: 0 note WHERE note.ticket_id=2) order by created
任何人都可以請解釋一下其中的0是從哪裏來的,爲什麼字符串形成不正確。
感謝
謝謝... ...會保持你的建議記住 – shazia 2011-03-12 11:49:16