[Gambas-user] Gambas Server Pages & mysql

Dimitris Anogiatis dosida at ...626...
Thu Apr 23 14:57:36 CEST 2009


Thanks Benoit that works like a charm :)
Regards
Dimitris

2009/4/22 Benoît Minisini <gambas at ...1...>

> > Hey guys,
> >
> > With the example below Gambas Server Pages were introduced.
> >
> > My question is:
> > 1) how would I achieve a connection to a mysql database or any database
> for
> > that matter?
> > 2) where in the code below would I put the necessary statements?
> > 3) if no direct reference to any database objects can be made is the
> > alternative, by lets say, using an external gambas module or some other
> > trick?
> >
> >
> --8<-----------------------------------------------------------------------
> >---------------------------------------------------------------
> >
> > #!/usr/bin/env gbw2
> > <%
> > DIM sEnv AS String
> > %>
> >
> > <!-- Variable declaration must come before any HTML -->
> >
> > <html>
> >
> > <h2>CGI script environmental variables</h2>
> >
> > <table border="1" cellspacing="0" cellpadding="2">
> >
> >   <tr>
> >     <th align="left">Name</th>
> >     <th align="left">Value</th>
> >   </tr>
> >
> > <% FOR EACH sEnv IN Application.Env %>
> >   <tr valign="top">
> >     <td><%= sEnv %></td>
> >     <td><%= Application.Env[sEnv] %> </td>
> >   </tr>
> > <% NEXT %>
> >
> > </table>
> >
> > </html>
> >
> --8<-----------------------------------------------------------------------
> >---------------------------------------------------------------
> >
> > Thanks in advance
> >
> > Regards
> > Dimitris
>
> You must add:
>
> <%
> USE "gb.db"
> %>
>
> at the beginning of the page, and then you can access any database.
>
> Regards,
>
> --
> Benoît
>
>
> ------------------------------------------------------------------------------
> Stay on top of everything new and different, both inside and
> around Java (TM) technology - register by April 22, and save
> $200 on the JavaOne (SM) conference, June 2-5, 2009, San Francisco.
> 300 plus technical and hands-on sessions. Register today.
> Use priority code J9JMT32. http://p.sf.net/sfu/p
> _______________________________________________
> Gambas-user mailing list
> Gambas-user at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/gambas-user
>



More information about the User mailing list