This Driver lets you call a mysql database within an Erlang program.
They provide an example for "Multiple Query and Multiple Result sets"
{ok, [{[<<"foo">>], [[42]]}, {[<<"bar">>], [[<<"baz">>]]}]} =
mysql:query(Pid, "SELECT 42 AS foo; SELECT 'baz' AS bar;"),
But don't really really explain it, or show how to use it without the AS
I would like to execute a query like
{ok, [{[<<Latitude>>, [Longitude], [Image], [Username], [Bio]} = mysql:query(Db, "SELECT * FROM users",[])
This is my regular select * from users
mysql> select * from users;
+----------+-----------+-------+----------+-----------+
| latitude | longitude | image | username | bio |
+----------+-----------+-------+----------+-----------+
| 44 | 44 | 45 | Sally | Hello |
| 42 | 43 | 0 | Bryce | I'm me |
| 20 | 24 | 0 | Richard | I'm Great |
| 44 | 45 | 0 | Liz | Yeah |
+----------+-----------+-------+----------+-----------+
So I would want the first column stored within the variable Latitude, the second column stored in Longitude .....