Reputation: 129
is it possible? if so, how?
I know php and MySQL run together with Apache.
but, how can I get access to the MySQL database using Yaws script?
Upvotes: 1
Views: 537
Reputation: 21137
Yes, it is possible, here is some example code:
<erl>
out(A) ->
application:start(odbc),
ConnString =
"Driver={MySQL ODBC 5.1 Driver};" ++
"Server=localhost;Database=test;" ++
"User=root;Password=ace152;" ++
"Option=3;",
{ok, Conn} = odbc:connect(ConnString, []),
Results = odbc:sql_query(Conn, "SELECT * FROM test_table"),
{html,"Something here."}.
</erl>
Upvotes: 3