xe id name 와 같은 식별자는 소문자와 _(언더라인)입니다. 뒷골 땡기네요.
- DB
- 일본어선생
- Sep 24, 2014
- 3461
아.... 3시간 정도 바보짓 하다고 알게되었습니다.
xe.... 깊게 들어가면 그들만의 룰을 발견하게 됩니다.
xe에서 db저장하는 query를 사용하려할 때
queries 폴더에 있는 insertBooking.xml 이런 파일의 컬럼 값을 잘 보면
<query id="insertBooking" action="insert"> <tables> <table name="booking" /> </tables> <columns> <column name="module_srl" var="module_srl" notnull="notnull" /> <column name="book_nr" var="dopbspcalendar_form_field_3" /> <column name="book_date" var="book_date"/> <column name="booker_name" var="dopbspcalendar_form_field_6" /> <column name="guest_names" var="guest_names" /> </columns> </query>
var 값이 모두 소문자이며 _(언더바)를 사용하였습니다.
만약 DOPBSPCalendar-form-field_3, 이런 식으로 대문자를 포함하거나 -(하이픈)을 사용하면 버그현상이 발생합니다.
원래 이 값은 <input name="DOPBSPCalendar-form-field_3" id="DOPBSPCalendar-form-field_3" value="" type="text">, 이런식으로 <form> 실행에서 건너 오는 값입니다.
xe를 설계한 사람은 이 식별자를 일단 action 으로 넘겨 booking.controller.php 에서 $output = executeQuery("booking.insertBooking", $obj); 가 실행되면서
$obj 로 건너온 식별자와 해당 값을 쿼리문에 활용하기위해
식별자를 변수명로 치환하도록 한 것 같습니다.
따라서 <input name="dopbspcalendar_form_field_3" id="dopbspcalendar_form_field_3" value="" type="text"> 으로 해야 에러가 발생하지 않습니다.
아무튼 xe 개발환경에서는 id, name 의 식별자에 일반 변수명 규칙이 적용됨을 유의하기 바랍니다.