concept string in category php

appears as: string, string, strings, strings
PHP in Action: Objects, Design, Agility

This is an excerpt from Manning's book PHP in Action: Objects, Design, Agility.

In real life, obviously, we would do something more sophisticated than just echoing a string.

In this section, we’ll start with a basic example of how to encapsulate an SQL query inside a method. Then, since we need to insert data into the queries, we’ll look at some different ways—beyond those offered by prepared statements—to substitute strings in SQL queries.

This requires that the $id and $name variables are set before this statement; so if what you want to do is set up an “SQL template” in a string and substitute the variables into it later, you need to do something else.