Examples of model querying
Page displays best with model debug set to true.
QUERY TO BE EXECUTED: -> select * from Entry where id = 1 and entry_name = 'First Lesson'
PLEASE NOTE: The query shown above is how the query would look before binding. PDO currently has no means of displaying previous query executed.
1
First Lesson
QUERY TO BE EXECUTED: -> select * from Entry where id = 1 and entry_name = 'First Lesson'
PLEASE NOTE: The query shown above is how the query would look before binding. PDO currently has no means of displaying previous query executed.
1
First Lesson
QUERY TO BE EXECUTED:
-> select * from Entry where entry_name = 'First Lesson'
1
First Lesson
QUERY TO BE EXECUTED:
-> SELECT MAX(id) AS max_id FROM Entry
4QUERY TO BE EXECUTED: -> SELECT * FROM Entry where entry_active = 0 order by id
PLEASE NOTE: The query shown above is how the query would look before binding. PDO currently has no means of displaying previous query executed.
3QUERY TO BE EXECUTED: -> SELECT * FROM Entry where id > 2 order by id
PLEASE NOTE: The query shown above is how the query would look before binding. PDO currently has no means of displaying previous query executed.
2QUERY TO BE EXECUTED:
-> SELECT COUNT(id) as total FROM Entry
3QUERY TO BE EXECUTED: -> SELECT * FROM Entry where id = 'x'
PLEASE NOTE: The query shown above is how the query would look before binding. PDO currently has no means of displaying previous query executed.
not foundQUERY TO BE EXECUTED: -> SELECT * FROM Entry where id = 1
PLEASE NOTE: The query shown above is how the query would look before binding. PDO currently has no means of displaying previous query executed.
First LessonQUERY TO BE EXECUTED: -> SELECT * FROM Entry where entry_name != 'First Lesson' order by id
PLEASE NOTE: The query shown above is how the query would look before binding. PDO currently has no means of displaying previous query executed.
3
Third Lesson
4
A new Lesson
QUERY TO BE EXECUTED: -> SELECT * FROM Entry order by entry_name desc
PLEASE NOTE: The query shown above is how the query would look before binding. PDO currently has no means of displaying previous query executed.
3
Third Lesson
1
First Lesson
4
A new Lesson