Table of contents:
This is a Stub article. Help the eZ Publish community by expanding it!
Use single quotes ( ' ) to quote literal string values, not double quotes ( " ). Certain database servers interpret a double quote as an identifier quote character.
Wrong:
UPDATE ezcontentobject SET name="Foo" WHERE id=500;
Right:
UPDATE ezcontentobject SET name='Foo' WHERE id=500;
By default MySQL allows double quotes to quote literal string values. However, you can turn on the ANSI_QUOTES SQL mode to make sure MySQL treats a double quote as an identifier quote character.
Columns should be aliased with the AS keyword (example 1), tables should NOT be aliased with the AS keyword (example 2).
Wrong:
SELECT COUNT(*) row_count FROM ezcontentobject;
Right:
SELECT COUNT(*) AS row_count FROM ezcontentobject;
Wrong:
SELECT o.id, u.name FROM ezcontentobject AS o, ezcontentobject AS u WHERE u.id=o.owner_id;
Right:
SELECT o.id, u.name FROM ezcontentobject o, ezcontentobject u WHERE u.id=o.owner_id;
Article provided by eZpedia
All text is available under the terms of the GNU Free Documentation License
Powered by eZ Publish Community Project 4.2011
Hosted by Swiss eZ Publish partner YMC