SqlQuery : the root of all

The base class for data access is the SqlQuery component.

It provides two fundamental methods : select() and exec(). As you can guess, select() is used to retrieve rows from the database, and exec() is used to execute SQL DML statements (like insert, update, delete), and even DDL instructions (create, alter, drop).

The arguments passed to these methods are :

  • The SQL statement (or its alias, we'll see this later)
  • (optional) An array containing the parameters that the statement may have.

 

We'll now see in details the exec() and select() methods.

Add new comment

Filtered HTML

  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <blockquote> <code> <ul> <ol> <li> <dl> <dt> <dd> <p> <pre>
  • Lines and paragraphs break automatically.

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.
CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.