What do the <<<SQL
and the SQL
mean?
$query = <<<SQL
INSERT INTO comments
( content )
VALUES
( '$content' )
SQL;
return mysql_query( $query ) or die( mysql_error() );
}
What do the <<<SQL
and the SQL
mean?
$query = <<<SQL
INSERT INTO comments
( content )
VALUES
( '$content' )
SQL;
return mysql_query( $query ) or die( mysql_error() );
}
In this case, it basically means same thing as this:
$query = "
INSERT INTO comments
( content )
VALUES
( '$content' )
";
More reading - http://www.php.net/manual/en/language.types.string.php#language.types.string.syntax.heredoc
It's the heredoc syntax, another way to store multiline strings.
You can find it in many scripting languages.