Update database.mysql.cmd.php

This commit is contained in:
Namhyeon Go 2019-09-16 13:28:11 +09:00 committed by GitHub
parent 1bfedfb09b
commit 4512a7fdfc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -15,12 +15,12 @@ if(check_function_exists("exec_db_mysql_cmd_query")) {
$sql = get_db_binded_sql($sql, $bind);
if(loadHelper("exectool")) {
$args[] = sprintf("-u%s", $config['db_username']);
$args[] = sprintf("-p%s", $config['db_password']);
$args[] = sprintf("-h%s", $config['db_host']);
$args[] = sprintf("-u'%s'", $config['db_username']);
$args[] = sprintf("-p'%s'", $config['db_password']);
$args[] = sprintf("-h'%s'", $config['db_host']);
$args[] = "-s"; // --slient
$args[] = sprintf("-D '%s'", $config['db_name']);
$args[] = sprintf("-e '%s'", make_safe_argument($sql));
$args[] = sprintf("-D'%s'", $config['db_name']);
$args[] = sprintf("-e'%s'", make_safe_argument($sql));
$cmd = implode(" ", $args);
$result = exec_command($cmd);
@ -40,7 +40,7 @@ if(check_function_exists("exec_db_mysql_cmd_fetch_all")) {
foreach ($lines as $line) {
$rows[] = str_getcsv($line, "\t");
}
if(count($rows) > 0) {
$result = $rows;
}