O'Reilly logo

PHP 5 CMS Framework Development by Martin Brampton

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Exploring SQL—MySQL and PHP

In this section, some useful SQL techniques are described. They are all used somewhere in the RBAC system, but most of them are generally applicable.

When joining tables in the ordinary way, it is better to use the explicit INNER JOIN words between the tables, and to add ON after the second table, followed by the conditions that define the join. This is clearer than using the comma notation and putting the join conditions in among the general WHERE conditions. It will also work in a wider variety of database systems, and therefore has portability benefits.

One commonly used device applies to situations where a SQL SELECT is built dynamically and may have differing numbers of WHERE conditions according to circumstances. ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required