Welcome to LinuxQuestions.
I am not a mysql user and therefore will make a few assumptions.
myvariable is a string not an array. I expect ${myvariable[0]} to be the entire string and ${myvariable[1]} to be blank. What does mysql use as a field separator in silent mode (-s) ie. a comma (,)?
I assumed there could be more then one row from your query so used tr to replace new lines with a "," which would allow you to split them into and array and iterate them as desired.
Code:
test=$( echo $myvariable | tr "\n " "," )
IFS=',' read -a stuff <<< "${test}"
cnt=${#stuff[*]}
for (( i=0 ; i<${cnt} ; i+=2 ))
do
echo_var ${stuff[$i]},${stuff[$i+1]}
done