It\'s work with PHP variables:
Prepearing one result from query function
extract($GLOBALS);
$GLOBALS[\'mysqli\'] = $mysqli;
function select($a
You've got to use a user defined variable:
User-Defined Variables
You can store a value in a user-defined variable in one statement and then refer to it later in another statement. This enables you to pass values from one statement to another. User-defined variables are session-specific. That is, a user variable defined by one client cannot be seen or used by other clients. All variables for a given client session are automatically freed when that client exits.
User variables are written as @var_name, where the variable name var_name consists of alphanumeric characters, “.”, “_”, and “$”. A user variable name can contain other characters if you quote it as a string or identifier (for example, @'my-var', @"my-var", or @
my-var
).
$query .= "SET @other = $other;"; // return: Unknown system variable 'other'