I have a problem with writing in the variable from table in MySQL database.
DB="--user=$OSD_USERNAME \
--password=$OSD_PASSWORD \
--database=$OSD_DB -N";
mysql --user="$user" \
--password="$password" \
--database="$database" \
--execute="DROP DATABASE $user; CREATE DATABASE $database;"
id_customer = $(echo "SELECT id FROM customers WHERE customers.customer='John'"| mysql $DB)
My problem is that id_customer is still empty. When I connect to mysql databases and put there this:
SELECT id FROM customers WHERE customers.customer='John'
then it give me table like this
+----+
| id |
+----+
| 1 |
+----+