Design Hotel Table For A Hotel Reservation System

Hello friends!

I’m new to PHP and Yii framework. So maybe my question is a little bit naive.

I’m creating a table name tbl_hotel to hold needed information for a hotel.

The problem is I don’t know if I should keep the description for the hotel by using a column named hotel_desc.

You know that description is quite big text, so I must you data type of TEXT. The problem is I want to format my description text so that I will look nicely when viewing it. For example the description would be:

When creating a new hotel, there would be a Hotel Desc field, so we can fill in with plain text. But I want to have the ability to use html tags inside that field, so we can create a list of items for example.

I remember when using Drupal CMS, when create a new main page, we can use html tags to form a body part for the page. Even better, we can use an addition module to have a text editor embedded in the field. Please, see the attached photo, please!



Sorry for a long post, but If you are still reading and know the topic just let me know your idea or a real solution, that you know or have experienced.

Anyway, thanks for reading my post!


There’s no issue with storing html in the description field, as long as the editor that you’re using protects against dangerous input, or you fully trust all users.

The easiest option is probably to use an extension such as tinymce or cleditor.

Also, note this comment regarding security.

Note that if you only want basic editing, you could use markdown syntax. It would make it easier to control formatting and keep the pages looking consistent. It depends who will be using the page and how much control they want over the style of the content.

hi Keith!

I will try all the solutions that you have suggested. In my case, the create will be granted to only admin. So off course we trust in our admin.

Thank for your help!