Thule - 0.9.6
  • Welcome
  • Introduction
  • - MVC(Model-View-Controller)
    - Architecture of Framework
    - Flow Chart of Application
    - Services In One Server
    - Developing Guide
    - Features
  • Installation
  • Getting Started
  • - Direct Access HTTP
    - Router Access HTTP
    - Router Direct Access HTTP
    - Reserved Function
    - Convention
    - Bootstrap
    - Pack Javascript , CSS
  • Basic Modules
  • - Model
    - View
    - Controller
  • Libraries
  • - Router
    - Config
    - Response
    - Request
    - Database
    - Query
    - Cache
    - Debug
    - Log
    - Unit Test
    - Registry
    - Profile
  • Helper
  • - Auth
    - Calendar
    - Date
    - Error page
    - Email
    - Form
    - GeoIP
    - Google
    - Html Element
    - Html
    - Http
    - I18n
    - Image
    - Json
    - Jquery
    - Login
    - Layout
    - Locale
    - PHP to Javascript
    - Paging
    - Payflow
    - Soap
    - Text
    - Table
    - Uri
    - Upload
    - Validation
  • Plugins
  • - Smarty Template Engine
  • History
  • Home > Query

    If you are a experienced php developer with huge scale and complex project, you had a knowledge about how important "SQL Query" is.
    Sometimes "SQL" solves the complex problem of service by easy way or it makes simple question to be big problem on your system, so If you have big scale site,DBA must be the management of "SQL"
    So, Here are queries made by XML for compatiblity. Have a look the database/queries/queries.xml

    Configuration

    Below is configuration of query file in config/dev_config.php

    // query xml file
    $config['query_xml_file']=DATABASE_PATH."/queries/queries.xml";

    Make the dynamic query in XML file

    <thuleframework> // query head tag
    <thule> //query section tag
        <query key='member'> select * from db_thule.tb_member where member_id='$member_id' </query>
    </thule>
    </thuleframework>

    Make the static query in XML file

    <thuleframework> // query head tag
    <static_thule> // query section tag
        <query key='member'> select * from db_thule.tb_member where member_id='?' </query>
    </static_thule>
    </thuleframework>

    Query-section-tag is a section for many other parts of site just like blog,home,profile,etc.. and "member" is a key of query.
    How to use query? go to Model chapter.

    The other format to represent aggregate of queries.

    You can choose the fil-format in configure.ini

    query_file_format = "sql" ; xml,sql

    The format is very similar with the XML format and you will get used it easily.

    [sample_thule]
    thule = "select * from DB_THULE.tb_member where member_id='$member_id'"
    thule_query1 = "select * from DB_THULE.tb_member where member_id='?'"
    thule_query2 = "update db_thule.tb_member set register_date=now() "