|
View:
New views
6 Messages
—
Rating Filter:
Alert me
|
|
|
yaws, erlang, mysqlHi,
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@... https://lists.sourceforge.net/lists/listinfo/erlyaws-list |
|
|
Re: yaws, erlang, mysqlIt 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@...> wrote: Hi, ------------------------------------------------------------------------------ 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@... https://lists.sourceforge.net/lists/listinfo/erlyaws-list |
|
|
Re: yaws, erlang, mysqlHi,
The error message I get is something like: Dynamic compile error: /usr/share/yaws/index.yaws:4: Regards, Sebastian On Thu, Sep 3, 2009 at 7:08 PM, andrew mmc <andrewmmc@...> 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. ------------------------------------------------------------------------------ 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@... https://lists.sourceforge.net/lists/listinfo/erlyaws-list |
|
|
Re: yaws, erlang, mysqlI 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@...> wrote: Hi, ------------------------------------------------------------------------------ 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@... https://lists.sourceforge.net/lists/listinfo/erlyaws-list |
|
|
Re: yaws, erlang, mysqlHi again, I would structure it like the below, everything should be contained in out(A). <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@...> 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/ ------------------------------------------------------------------------------ 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@... https://lists.sourceforge.net/lists/listinfo/erlyaws-list |
|
|
Re: yaws, erlang, mysqlOn Fri, 4 Sep 2009 00:30:05 +0200
andrew mmc <andrewmmc@...> wrote: > 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> Why not just write it like any normal Erlang function? <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> -- Hans Ulrich Niedermann ------------------------------------------------------------------------------ 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@... https://lists.sourceforge.net/lists/listinfo/erlyaws-list |
| Free embeddable forum powered by Nabble | Forum Help |