You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
And what I mean by that is people will have problems like how to issue "SELECT field FROM table WHETE field > value" commands via Zend_Db. They don't have any idea about the object names and relations when they start to use ZF2.
I had the same issue, wondering if I should use $adapter->query() or $sql->select() etc. And thats when I had spend many hours reading docs, watching webinars etc.
When I came to conclusion that $sql->select|insert|update|delete is the most logic route for DML and $adapter is the only way to do Store procedures I still pumped to some problems Zend Db 2.0 has right now. For example its not possible to issue WHERE field < SYSDATE() via $sql->select object. (Recent update in github might have fixed that predicate inside predicate problem, haven't tested yet).
But all that trouble that I have had finding a solution how to do simple everyday queries lead me to a thought that there really should be examples from SQL perspective not Zend Db object perspective.
Just an idea what I mean by examples from SQL perspective:
SELECT * FROM table;
SELECT field1, field2 FROM table WHERE field3 = 'some value' ORDER BY field2 DESC, field2 ASC;
SELECT t1., t2. FROM table1 AS t1 INNER JOIN table2 AS t2 ON t1.id = t2.id;
SELECT COUNT(*) AS total, CONCAT(field1, ' ', field2) AS fields FROM table WHERE field1 > NOW() GROUP BY field3 DESC HAVING field3 IS NOT NULL;
SELECT * FROM table LIMIT 5,10;
CALL someStoreProc(@someParam);
If there would be best practice examples for these queries it would be easy to modify and tweak them so that they would solve most of every day use cases.
The text was updated successfully, but these errors were encountered:
And what I mean by that is people will have problems like how to issue "SELECT field FROM table WHETE field > value" commands via Zend_Db. They don't have any idea about the object names and relations when they start to use ZF2.
I had the same issue, wondering if I should use $adapter->query() or $sql->select() etc. And thats when I had spend many hours reading docs, watching webinars etc.
When I came to conclusion that $sql->select|insert|update|delete is the most logic route for DML and $adapter is the only way to do Store procedures I still pumped to some problems Zend Db 2.0 has right now. For example its not possible to issue WHERE field < SYSDATE() via $sql->select object. (Recent update in github might have fixed that predicate inside predicate problem, haven't tested yet).
But all that trouble that I have had finding a solution how to do simple everyday queries lead me to a thought that there really should be examples from SQL perspective not Zend Db object perspective.
Just an idea what I mean by examples from SQL perspective:
SELECT * FROM table;
SELECT field1, field2 FROM table WHERE field3 = 'some value' ORDER BY field2 DESC, field2 ASC;
SELECT t1., t2. FROM table1 AS t1 INNER JOIN table2 AS t2 ON t1.id = t2.id;
SELECT COUNT(*) AS total, CONCAT(field1, ' ', field2) AS fields FROM table WHERE field1 > NOW() GROUP BY field3 DESC HAVING field3 IS NOT NULL;
SELECT * FROM table LIMIT 5,10;
CALL someStoreProc(@someParam);
If there would be best practice examples for these queries it would be easy to modify and tweak them so that they would solve most of every day use cases.
The text was updated successfully, but these errors were encountered: