Im new in bash scripting. I want to save sql-query outputs in variable, but
actually I must connect for every query to mysql with:
mysql -u $MYUSER -p$MY
I did this
variable=mysql -u root -ppassworrd database << EOF select MAX(variable) AS a from table where variable2 = 'SOMETEXT' AND day(datevalue) >= 22; EOF
mysql -u root -ppassworrd database << EOF select MAX(variable) AS a from table where variable2 = 'SOMETEXT' AND day(datevalue) >= 22; EOF
I hope it helps