Zend Framework 2 Advanced database operations ?

In this post i would like to list basic to advanced database queries using ZF2. I am gonna use TableGateway methods here.

Simple Select Query

SQL statement is

Select Query with Where condition

SQL statement is

Select Query with Where condition

SQL statement is

SELECT MAX(field)

SQL statement is

SELECT MIN(field)

SQL statement is

SELECT AVG(field)

SQL statement is

SELECT SUM(field)

SQL statement is

Inner Join with where condition

SQL statement is

Left join with where condition

SQL statement is

Where – OR

SQL statement is

Where – AND

SQL statement is

Where -Combined And – OR

SQL statement is

Where Combined OR – AND

SQL statement is

That’s it.

I hope you like this Post, Please feel free to comment below, your suggestion and problems if you face - we are here to solve your problems.

0 0 vote
Article Rating
Subscribe
Notify of
guest
4 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
Wael Shawky
Wael Shawky
5 years ago

getServiceLocator could not be found .when i tried this code.. how can i solve it _

arjun
5 years ago
Reply to  Wael Shawky

are you calling getServiceLocatror from controller or from other place?

arjun
5 years ago

🙂

黃致堯
黃致堯
4 years ago

Thank you ! very useful

DMCA.com Protection Status
4
0
Would love your thoughts, please comment.x
()
x