It is difficult to find a title for this :D
I have this code:
data=( "slots" "npcs" )
for i in "${data[@]}"
do
"$i"=$(mysql_exec "SELECT $i FROM orders WHERE order_id = $order") # slots returns 5 and npcs returns 1
done
In the loop, I want to create a variable with the name of content from $i.
So it should create a variable named slots (content: 5) and npcs (content: 1)
I hope you understand my problem :P
Errors:
./install: Line 16: slots=5: command not found.
./install: Line 16: npcs=1: command not found.