MV Func db_query()

This commit is contained in:
6543 2019-05-11 23:50:13 +02:00
parent 6d36742007
commit 3b09ccdf86
3 changed files with 14 additions and 25 deletions

View File

@ -31,3 +31,14 @@ function db_check() {
echo $FALSE echo $FALSE
fi fi
} }

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

View File

@ -138,18 +138,7 @@ function md5_out_del() {
exit 0 exit 0
} }


# help functions #all loaded stat now

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

case "$mode" in case "$mode" in
"a") #in_add "a") #in_add
md5_in_add md5_in_add

View File

@ -197,16 +197,5 @@ function file_add() {


} }



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

main #aufruf der main function (eig. programmstart)