Many examples found in this book involve embedding MySQL queries directly into a PHP script. Indeed, for smaller applications this is fine; however, as application complexity and size increase, you’ll probably want to seek out more effective ways to manage your SQL code. Notably, some queries will reach a level of complexity that will require you to incorporate a certain degree of logic into the query in order to achieve the desired result. Consider a situation in which you deploy two applications: one targeting the Web and another targeting a mobile device, both of which use the same MySQL database and perform many of the same tasks. If a query changed, you’d need to make modifications wherever that query appeared not in one application but in two or more!