- modular db_query

- empty password wont be asked animore
This commit is contained in:
6543 2019-02-07 22:14:31 +01:00
parent d95a7ea54f
commit ba3ac3b276

View File

@ -80,7 +80,12 @@ function md5_out_del() {

# db_query <query> -> result
function db_query() {
echo $@ | mysql -h$dbhost -u$dbuser -p$dbpwd $dbname
local args="-sN" #no headers, no grid
args+=" -h$dbhost"
args+=" -u$dbuser"
[ -n "$dbpwd" ] && args+=" -p$dbpwd"
args+=" $dbname"
echo $@ | mysql $args
}

# db_exist_md5 <md5> -> true/false 0/1