Answers for "concat in mysql as"

PHP
0

define a variable in mysql from select

SELECT salary INTO @variable1 FROM employee_info WHERE emp_id = 12345678 LIMIT 1;
SELECT salary, salary_group INTO @var1, @var2 FROM employee_info WHERE emp_id = 12345678;
Posted by: Guest on March-17-2020
0

laravel get query in normal sql without bindings

/**
 * Combines SQL and its bindings
 *
 * @param \Eloquent $query
 * @return string
 */
public static function getEloquentSqlWithBindings($query)
{
    return vsprintf(str_replace('?', '%s', $query->toSql()), collect($query->getBindings())->map(function ($binding) {
        $binding = addslashes($binding);
        return is_numeric($binding) ? $binding : "'{$binding}'";
    })->toArray());
}
Posted by: Guest on May-05-2020

Browse Popular Code Answers by Language