Hi again, I would structure it like the below, everything should be contained in out(A).

<html> 
<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> 
</html> 


On Fri, Sep 4, 2009 at 12:18 AM, andrew mmc <andrewmmc@gmail.com> wrote:
I wasn't looking at the code but now I see you have periods at the end of each line instead of commas which won't help.  I'm afraid I don't use odbc, so I can't tell without looking it up whether you have other coding errors.  Good docs are at: http://erlapi.prepor.ru/docs/


On Fri, Sep 4, 2009 at 12:12 AM, Sebastian Harko <sebastian.harko@gmail.com> wrote:
Hi,

The error message I get is something like:
Dynamic compile error: /usr/share/yaws/index.yaws:4:
syntax error before: ':'
generated file at: /var/cache/yaws/.yaws/yaws/debian_yaws/m25.erl

Regards,
Sebastian


On Thu, Sep 3, 2009 at 7:08 PM, andrew mmc <andrewmmc@gmail.com> wrote:
It is hard to tell what the problem is without some form of error message to show where the failure is, but this could be a number of things.  Are privileges set up correctly on the mysql server to allow remote connections?  Are the relevant firewall ports open on both machines?  Those would be the first two things to check in the absence of any more information.

On Thu, Sep 3, 2009 at 11:05 PM, Sebastian Harko <sebastian.harko@gmail.com> wrote:
Hi,
This should be super easy :
I have a YAWS server and a MySQL server running under Ubuntu. I want to establish a connection from an erlang-html page to the MySQL server. Here's what I have:

Code:

<html>
<erl>
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").
out(A)->{html,"Something here."}.
</erl>
</htmL>

[/code]


So, Why doesn't this work ? Any ideas ?


------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Erlyaws-list mailing list
Erlyaws-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/erlyaws-list




------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Erlyaws-list mailing list
Erlyaws-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/erlyaws-list