1

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?

Daniel
  • 20,420
  • 10
  • 92
  • 149
Kit Fox
  • 129
  • 1
  • 5

1 Answers1

3

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> 
Daniel
  • 20,420
  • 10
  • 92
  • 149