Latelly I saw many PHP / MySQL questions that include SQL values in {}, for example:
{}
SELECT * FROM table WHERE field LIKE '{$value}';
What's up with that? Is it really? Why do so many people use this weird (at least for me) syntax?
From php.net :
Complex (curly) syntaxThis is not called complex because the syntax is complex, but because it allows you to use a complex expression.. , , }. { , , $ {. {\ $, literal {$.
Complex (curly) syntax
This is not called complex because the syntax is complex, but because it allows you to use a complex expression.
. , , }. { , , $ {. {\ $, literal {$.
, , , :
$SQL = "Select * FROM table WHERE field LIKE '{$value[5]}'";
.
PHP.net
$beer = 'Heineken'; echo "$beer taste is great"; // works; "'" is an invalid character for variable names echo "He drank some $beers"; // won't work; 's' is a valid character for variable names but the variable is "$beer" echo "He drank some ${beer}s"; // works echo "He drank some {$beer}s"; // works
http://php.net/manual/en/language.types.string.php
Source: https://habr.com/ru/post/1730671/More articles:Preventing vulgarity in a text box? - asp.netMultilingual sites: left to right and right to left - javascriptdata type for checkboxes in php - mysqlIs there a workaround for z-index stacking contexts? - htmlhttps://translate.googleusercontent.com/translate_c?depth=1&pto=aue&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=https://fooobar.com/questions/1730670/should-i-use-an-in-memory-database-instead-of-mocking-out-my-repositories&usg=ALkJrhjIXPf8L2pFQE3AHxGofIJEYge-dgЧто вы называете пакетом Java, если он не является частью домена верхнего уровня? - javaFunctions for C # System State - c #при написании клиента POP3 в C - cHow to find yahoo mail or gmail sender ip address? - emailASP.NET ~ / does not allow "/" - asp.netAll Articles