Create New Post

CodeIgniter MCQs with answer part - 5

  1. What is the purpose of CodeIgniter's Query Builder class?

    • A) To build and execute SQL queries
    • B) To manage database connections
    • C) To handle form submissions
    • D) To generate HTML forms

    Answer: A) To build and execute SQL queries

  2. Which method is used to select data from a database using CodeIgniter's Query Builder?

    • A) select()
    • B) get()
    • C) query()
    • D) fetch()

    Answer: B) get()

  3. How do you specify a table to select data from using CodeIgniter's Query Builder?

    • A) By passing the table name as an argument to the select() method
    • B) By using the from() method
    • C) By calling the table() method
    • D) By using the join() method

    Answer: B) By using the from() method

  4. Which method is used to add a WHERE clause to a CodeIgniter query?

    • A) where()
    • B) select()
    • C) from()
    • D) get()

    Answer: A) where()

  5. What is the purpose of CodeIgniter's Pagination library?

    • A) To handle form submissions
    • B) To manage user authentication
    • C) To split large sets of data into multiple pages
    • D) To generate HTML forms

    Answer: C) To split large sets of data into multiple pages

  6. How do you load the Pagination library in a CodeIgniter controller?

    • A) $this->load->library('pagination')
    • B) $this->pagination->load()
    • C) $this->pagination->library('pagination')
    • D) $this->library('pagination')

    Answer: A) $this->load->library('pagination')

  7. Which method is used to initialize pagination in CodeIgniter?

    • A) initialize()
    • B) setup()
    • C) config()
    • D) paginate()

    Answer: A) initialize()

  8. How do you generate pagination links in a CodeIgniter view?

    • A) By calling the generate_links() method
    • B) By using the pagination_links() function
    • C) By accessing the $pagination_links variable
    • D) By using the create_links() function

    Answer: D) By using the create_links() function

  9. Which of the following methods is used to limit the number of results in a CodeIgniter query?

    • A) limit()
    • B) offset()
    • C) row()
    • D) result()

    Answer: A) limit()

  10. What is the purpose of CodeIgniter's File Upload class?

    • A) To manage database connections
    • B) To handle form submissions
    • C) To upload files to the server
    • D) To generate HTML forms

    Answer: C) To upload files to the server

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *

84605