Update database.mysql.cmd.php
This commit is contained in:
parent
1bfedfb09b
commit
4512a7fdfc
|
@ -15,12 +15,12 @@ if(check_function_exists("exec_db_mysql_cmd_query")) {
|
||||||
$sql = get_db_binded_sql($sql, $bind);
|
$sql = get_db_binded_sql($sql, $bind);
|
||||||
|
|
||||||
if(loadHelper("exectool")) {
|
if(loadHelper("exectool")) {
|
||||||
$args[] = sprintf("-u%s", $config['db_username']);
|
$args[] = sprintf("-u'%s'", $config['db_username']);
|
||||||
$args[] = sprintf("-p%s", $config['db_password']);
|
$args[] = sprintf("-p'%s'", $config['db_password']);
|
||||||
$args[] = sprintf("-h%s", $config['db_host']);
|
$args[] = sprintf("-h'%s'", $config['db_host']);
|
||||||
$args[] = "-s"; // --slient
|
$args[] = "-s"; // --slient
|
||||||
$args[] = sprintf("-D '%s'", $config['db_name']);
|
$args[] = sprintf("-D'%s'", $config['db_name']);
|
||||||
$args[] = sprintf("-e '%s'", make_safe_argument($sql));
|
$args[] = sprintf("-e'%s'", make_safe_argument($sql));
|
||||||
|
|
||||||
$cmd = implode(" ", $args);
|
$cmd = implode(" ", $args);
|
||||||
$result = exec_command($cmd);
|
$result = exec_command($cmd);
|
||||||
|
@ -40,7 +40,7 @@ if(check_function_exists("exec_db_mysql_cmd_fetch_all")) {
|
||||||
foreach ($lines as $line) {
|
foreach ($lines as $line) {
|
||||||
$rows[] = str_getcsv($line, "\t");
|
$rows[] = str_getcsv($line, "\t");
|
||||||
}
|
}
|
||||||
|
|
||||||
if(count($rows) > 0) {
|
if(count($rows) > 0) {
|
||||||
$result = $rows;
|
$result = $rows;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user