I just happened to see the following way to compose a parameterized SQL query:
function select_user($uid)
{
// what is '<<<'?
// I can't google any document about it
// (or I don't know how to search symbol)
$sqlStr = <<< SQL_STR
SELECT * FROM user WHERE uid = ?
SQL_STR; // must put in the begin of the line
// and it must match the word at the right hand side of '= <<<'
// Code Igniter Database Class
return $this->db->query($sqlStr, array($uid));
}
To rephrase my questions in here:
- What the symbol '
<<<' does? - My colleague said that '
SQL_STR' must be matched, why?