Update database.mysql.cmd.php

This commit is contained in:
Namhyeon Go 2019-09-16 10:51:09 +09:00 committed by GitHub
parent 2ebf144992
commit feb2a7d594
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -6,7 +6,7 @@
* @brief MySQL(MariaDB) command line driver
*/
if(function_exists("exec_db_mysql_cmd_query")) {
if(check_function_exists("exec_db_mysql_cmd_query")) {
function exec_db_mysql_cmd_query($sql, $bind) {
$result = false;
$config = get_config();
@ -18,7 +18,7 @@ if(function_exists("exec_db_mysql_cmd_query")) {
$args[] = sprintf("-u%s", $config['db_username']);
$args[] = sprintf("-p%s", $config['db_password']);
$args[] = sprintf("-h%s", $config['db_host']);
$args[] = sprintf("-D %s", $config['db_name']);
$args[] = sprintf("-D '%s'", $config['db_name']);
$args[] = sprintf("-e '%s'", make_safe_argument($sql));
$cmd = trim(implode(" ", $args));
@ -28,3 +28,10 @@ if(function_exists("exec_db_mysql_cmd_query")) {
return $result;
}
}
if(check_function_exists("exec_db_mysql_cmd_fetch_all")) {
function exec_db_mysql_cmd_fetch_all() {
// todo
}
}