dumb question? (bis)

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

dumb question? (bis)

XL Cordemans

Hi,

I started with lasso 3.x  & FMP, jumped to lasso 8.5 with SQLlite (and loved it), now need to work with MySQL and Laso 8.6 (on Mac mini with Snow Leopard server 10.6.7 ). I am not a programmer but quite familiar with the traditional encoding when using  lasso. Now the question:

I created the DB on MySQL 5.0x that came with the server and can access it using ODBC and FMP for example ; no problems in creating records etc. BUT when using the traditional code of Lasso [inline][/inline] to simply add a single simple record it returned this:

(error code) 1064
(error message) HY000 [Actual][MySQL] You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '"fieldname") VALUES ('MYNAME')' at line 1

The dead simple code I used is (mysql is on another machine):

[var:'Vuser'=(form_param:'somefield')]

[inline:
-Host=(Array:-Datasource='odbc', -Name='whatever', -Username='xxx', -Password='yyy'),
-database='DBname', -table='DBtable', 'fieldname'=$Vuser, -add]


then I found this from Fletcher (http://lasso.2283332.n4.nabble.com/What-s-wrong-with-my-sql-INSERT-syntax-td3107790.html ) [OK, that was back in 2006]:

{ ..... Or, you can use a traditional inline to do the same thing.  Lasso handles the quoting and encoding for you.

[inline: -database='...', -table='events', -add, 'e_date'=$e_date, 'e_time'=$e_time, 'eventname'=$event_name, 'place'=$place, 'agenda'=$agenda, 'contact'=$contact, 'email'=$email, 'phone'=$phone, 'calendar'=$calendar, 'details'=$details]
[/inline]

....}

Now I checked with another lasso user but running Lasso version 8.1.0 and he is using the same 'traditional' approach with no problems.  But I am using the mysql that came with Snow Leopard Server 10.6.7 with Lasso 8.6  , it looks like the MySQL is version 5.0x .

I need to keep it simple, and am looking for a plain traditional coding if possible ...


Thanks

#############################################################
This message is sent to you because you are subscribed to
  the mailing list <[hidden email]>.
To unsubscribe, E-mail to: <[hidden email]>
To switch to the DIGEST mode, E-mail to <[hidden email]>
To switch to the INDEX mode, E-mail to <[hidden email]>
Send administrative queries to  <[hidden email]>

Reply | Threaded
Open this post in threaded view
|

Re: dumb question? (bis)

stevepiercy
This has nothing to do with encoding.  Yet.  The problem is how
you define a connection to a database in your inline.  You are
trying to make Lasso connect to MySQL using an ODBC connector
with the "inline host" method, when you should use the Lasso
MySQL connector.

For every database connector, there are two inline methods:
* inline host requires an array of connection parameters as
specified in the -host parameter, and it bypasses Lasso Security
settings in Lasso SiteAdmin.
* traditional inlines do not use a -host parameter, and are
typically configured in Lasso Security settings in Lasso SiteAdmin.

Bypassing Lasso Security is not a bad thing, and may be
desirable.  For simplicity, let us use the inline host method.

Assuming you have the Lasso MySQL connector enabled and that you
use it instead of the ODBC connector, here is what your inline
should look like:

[
     inline(
         -host=array(// the following are the data source
connection parameters
             -datasource='mysqlds',
             -name='your_mysql_server_host_name',
             -username='xxx',
             -password='yyy'),
         -database='dbname',
         -table='dbtable',
         -sql='SELECT * FROM `dbtble` LIMIT 0,50' // this can be
either an SQL statement or traditional field/value pairs
('field' = 'value'), optionally any Lasso operators (-eq, -neq,
etc.), and with a Lasso action (-add, -search, etc.).
         );
         records_array;
         '<br>';
         action_statement;
         '<br>';
         error_currenterror;
     /inline;
]

Have a go with that code snippet and let us know whether you
have any error reported by the inline.

--steve


On 7/15/11 at 4:02 AM, [hidden email] (XL Cordemans) pronounced:

>Hi,
>I started with lasso 3.x  & FMP, jumped to lasso 8.5 with
>SQLlite (and loved it), now need to work with MySQL and Laso
>8.6 (on Mac mini with Snow Leopard server 10.6.7 ). I am not a
>programmer but quite familiar with the traditional encoding
>when using  lasso. Now the question:
>
>I created the DB on MySQL 5.0x that came with the server and
>can access it using ODBC and FMP for example ; no problems in
>creating records etc. BUT when using the traditional code of
>Lasso [inline][/inline] to simply add a single simple record it
>returned this:
>
>(error code) 1064
>(error message) HY000 [Actual][MySQL] You have an error in your
>SQL syntax; check the manual that corresponds to your MySQL
>server version for the right syntax to use near '"fieldname")
>VALUES ('MYNAME')' at line 1
>The dead simple code I used is (mysql is on another machine):
>
>[var:'Vuser'=(form_param:'somefield')]
>
>[inline: -Host=(Array:-Datasource='odbc', -Name='whatever',
>-Username='xxx', -Password='yyy'),
>-database='DBname', -table='DBtable', 'fieldname'=$Vuser, -add]
>
>
>then I found this from Fletcher (http://lasso.2283332.n4.nabble.com/What-s-wrong-with-my-sql-INSERT-syntax-td3107790
>.html ) [OK, that was back in 2006]:
>
>{ ..... Or, you can use a traditional inline to do the same
>thing.  Lasso handles the quoting and encoding for you.
>[inline: -database='...', -table='events', -add,
>'e_date'=$e_date, 'e_time'=$e_time, 'eventname'=$event_name,
>'place'=$place, 'agenda'=$agenda, 'contact'=$contact,
>'email'=$email, 'phone'=$phone, 'calendar'=$calendar,
>'details'=$details] [/inline]
>....}
>
>Now I checked with another lasso user but running Lasso version
>8.1.0 and he is using the same 'traditional' approach with no
>problems.  But I am using the mysql that came with Snow Leopard
>Server 10.6.7 with Lasso 8.6  , it looks like the MySQL is
>version 5.0x .
>
>I need to keep it simple, and am looking for a plain
>traditional coding if possible ...
>
>
>Thanks
>
>#############################################################
>This message is sent to you because you are subscribed to
>the mailing list <[hidden email]>.
>To unsubscribe, E-mail to: <[hidden email]>
>To switch to the DIGEST mode, E-mail to <[hidden email]>
>To switch to the INDEX mode, E-mail to <[hidden email]>
>Send administrative queries to  <[hidden email]>
>

-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-- --
Steve Piercy               Web Site Builder              
Soquel, CA
<[hidden email]>                  <http://www.StevePiercy.com/>


#############################################################
This message is sent to you because you are subscribed to
  the mailing list <[hidden email]>.
To unsubscribe, E-mail to: <[hidden email]>
To switch to the DIGEST mode, E-mail to <[hidden email]>
To switch to the INDEX mode, E-mail to <[hidden email]>
Send administrative queries to  <[hidden email]>

Reply | Threaded
Open this post in threaded view
|

Re: dumb question? (bis)

Ke Carlton-3
In reply to this post by XL Cordemans
Hello,

You'll have better performance and most likely less issues if you use
the mysql connector:

inline(
  -Host=array(-Datasource='mysqlds', -Name='whatever',
-Username='xxx', -Password='yyy'),
  -database='DBname',
  -table='DBtable',
  'fieldname'=$Vuser,
  -add
)

It may be worth giving that a go.

Ke

On 15 July 2011 12:02, XL Cordemans <[hidden email]> wrote:

>
> Hi,
>
> I started with lasso 3.x  & FMP, jumped to lasso 8.5 with SQLlite (and loved it), now need to work with MySQL and Laso 8.6 (on Mac mini with Snow Leopard server 10.6.7 ). I am not a programmer but quite familiar with the traditional encoding when using  lasso. Now the question:
>
> I created the DB on MySQL 5.0x that came with the server and can access it using ODBC and FMP for example ; no problems in creating records etc. BUT when using the traditional code of Lasso [inline][/inline] to simply add a single simple record it returned this:
>
> (error code) 1064
> (error message) HY000 [Actual][MySQL] You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '"fieldname") VALUES ('MYNAME')' at line 1
>
> The dead simple code I used is (mysql is on another machine):
>
> [var:'Vuser'=(form_param:'somefield')]
>
> [inline:
> -Host=(Array:-Datasource='odbc', -Name='whatever', -Username='xxx', -Password='yyy'),
> -database='DBname', -table='DBtable', 'fieldname'=$Vuser, -add]
>
>
> then I found this from Fletcher (http://lasso.2283332.n4.nabble.com/What-s-wrong-with-my-sql-INSERT-syntax-td3107790.html ) [OK, that was back in 2006]:
>
> { ..... Or, you can use a traditional inline to do the same thing.  Lasso handles the quoting and encoding for you.
>
> [inline: -database='...', -table='events', -add, 'e_date'=$e_date, 'e_time'=$e_time, 'eventname'=$event_name, 'place'=$place, 'agenda'=$agenda, 'contact'=$contact, 'email'=$email, 'phone'=$phone, 'calendar'=$calendar, 'details'=$details]
> [/inline]
>
> ....}
>
> Now I checked with another lasso user but running Lasso version 8.1.0 and he is using the same 'traditional' approach with no problems.  But I am using the mysql that came with Snow Leopard Server 10.6.7 with Lasso 8.6  , it looks like the MySQL is version 5.0x .
>
> I need to keep it simple, and am looking for a plain traditional coding if possible ...
>
>
> Thanks
>
> #############################################################
> This message is sent to you because you are subscribed to
>  the mailing list <[hidden email]>.
> To unsubscribe, E-mail to: <[hidden email]>
> To switch to the DIGEST mode, E-mail to <[hidden email]>
> To switch to the INDEX mode, E-mail to <[hidden email]>
> Send administrative queries to  <[hidden email]>
>
>

#############################################################
This message is sent to you because you are subscribed to
  the mailing list <[hidden email]>.
To unsubscribe, E-mail to: <[hidden email]>
To switch to the DIGEST mode, E-mail to <[hidden email]>
To switch to the INDEX mode, E-mail to <[hidden email]>
Send administrative queries to  <[hidden email]>

Reply | Threaded
Open this post in threaded view
|

Re: dumb question? (bis)

XL Cordemans
Thank you Ke,

that was it indeed. My mistake was to use the name that was set-up om the ODBC manager on the local development machine here, it does not work indeed.



--- On Fri, 7/15/11, Ke Carlton <[hidden email]> wrote:

> From: Ke Carlton <[hidden email]>
> Subject: Re: dumb question? (bis)
> To: [hidden email]
> Date: Friday, July 15, 2011, 7:28 PM
> Hello,
>
> You'll have better performance and most likely less issues
> if you use
> the mysql connector:
>
> inline(
>   -Host=array(-Datasource='mysqlds',
> -Name='whatever',
> -Username='xxx', -Password='yyy'),
>   -database='DBname',
>   -table='DBtable',
>   'fieldname'=$Vuser,
>   -add
> )
>
> It may be worth giving that a go.
>
> Ke
>
> On 15 July 2011 12:02, XL Cordemans <[hidden email]>
> wrote:
> >
> > Hi,
> >
> > I started with lasso 3.x  & FMP, jumped to lasso
> 8.5 with SQLlite (and loved it), now need to work with MySQL
> and Laso 8.6 (on Mac mini with Snow Leopard server 10.6.7 ).
> I am not a programmer but quite familiar with the
> traditional encoding when using  lasso. Now the question:
> >
> > I created the DB on MySQL 5.0x that came with the
> server and can access it using ODBC and FMP for example ; no
> problems in creating records etc. BUT when using the
> traditional code of Lasso [inline][/inline] to simply add a
> single simple record it returned this:
> >
> > (error code) 1064
> > (error message) HY000 [Actual][MySQL] You have an
> error in your SQL syntax; check the manual that corresponds
> to your MySQL server version for the right syntax to use
> near '"fieldname") VALUES ('MYNAME')' at line 1
> >
> > The dead simple code I used is (mysql is on another
> machine):
> >
> > [var:'Vuser'=(form_param:'somefield')]
> >
> > [inline:
> > -Host=(Array:-Datasource='odbc', -Name='whatever',
> -Username='xxx', -Password='yyy'),
> > -database='DBname', -table='DBtable',
> 'fieldname'=$Vuser, -add]
> >
> >
> > then I found this from Fletcher (http://lasso.2283332.n4.nabble.com/What-s-wrong-with-my-sql-INSERT-syntax-td3107790.html
> ) [OK, that was back in 2006]:
> >
> > { ..... Or, you can use a traditional inline to do the
> same thing.  Lasso handles the quoting and encoding for
> you.
> >
> > [inline: -database='...', -table='events', -add,
> 'e_date'=$e_date, 'e_time'=$e_time, 'eventname'=$event_name,
> 'place'=$place, 'agenda'=$agenda, 'contact'=$contact,
> 'email'=$email, 'phone'=$phone, 'calendar'=$calendar,
> 'details'=$details]
> > [/inline]
> >
> > ....}
> >
> > Now I checked with another lasso user but running
> Lasso version 8.1.0 and he is using the same 'traditional'
> approach with no problems.  But I am using the mysql that
> came with Snow Leopard Server 10.6.7 with Lasso 8.6  , it
> looks like the MySQL is version 5.0x .
> >
> > I need to keep it simple, and am looking for a plain
> traditional coding if possible ...
> >
> >
> > Thanks
> >
> >
> #############################################################
> > This message is sent to you because you are subscribed
> to
> >  the mailing list <[hidden email]>.
> > To unsubscribe, E-mail to: <[hidden email]>
> > To switch to the DIGEST mode, E-mail to <[hidden email]>
> > To switch to the INDEX mode, E-mail to <[hidden email]>
> > Send administrative queries to  <[hidden email]>
> >
> >
>
> #############################################################
> This message is sent to you because you are subscribed to
>   the mailing list <[hidden email]>.
> To unsubscribe, E-mail to: <[hidden email]>
> To switch to the DIGEST mode, E-mail to <[hidden email]>
> To switch to the INDEX mode, E-mail to <[hidden email]>
> Send administrative queries to  <[hidden email]>
>
>

#############################################################
This message is sent to you because you are subscribed to
  the mailing list <[hidden email]>.
To unsubscribe, E-mail to: <[hidden email]>
To switch to the DIGEST mode, E-mail to <[hidden email]>
To switch to the INDEX mode, E-mail to <[hidden email]>
Send administrative queries to  <[hidden email]>