Re: mySQL Host access

2016-01-07 Thread Peter Haworth
Hi Lyn,
Thanks for that info, that will certainly help me when I start looking into
LC server.  Unfortunately, I think I'm about 6 months into a 2-year
contract with my current web host so probably could not switch at this
point.


On Thu, Jan 7, 2016 at 4:17 PM Lyn Teyla  wrote:

> Peter Haworth wrote:
>
> > Is this common practice when accessing mySQL on a host server?  If so, is
> > there a better way to set about accessing a mySQL database in these
> > circumstances, perhaps using php scripts on the server instead of
> accessing
> > the db directly with the LC database functions?
>
> One of my hosting providers HostM.com has been offering a free
> LiveCode-based MariaDB/MySQL API solution. It was previously available only
> to clients who needed this setup.
>
> I told them about the widespread interest in the LiveCode community for
> such a solution, and they’ve kindly made their API demo available for free
> download by any LiveCode developer.
>
> You can download it at:
>
> https://www.hostm.com/tutorials/livecode/api-mariadb-mysql
>
> Hope this helps!
>
> Lyn
>
>
>
> ___
> use-livecode mailing list
> use-livecode@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Re: mySQL Host access

2016-01-07 Thread Peter Haworth
Hi Alex,
You're probably right on the lc server issue (and thanks for the
compliment).

I already had a library of php db access scripts on my server which I've
been using in batch cron jobson a nightly basis so the guts of what I
needed to do was already in place, whereas I have never installed LC server
or used it.  Now that it's all working I will probably try using LC
server.  My web host is Dreamhost - does anyone know if they support LC
server?

I have all this working now using php middleware.  I ended up using the LC
post command with a command code that indicates what SQL action is required
plus other parameters that contain the required data for the SQL action.

The php script return a JSON containing either the data from SELECT
statements, number of rows affected for INSERT/UPDATE/DELETE, or error
message information if there's a mySQL error.

No SQL commands are sent out, they are all constructed by the sever php
script.  I think, but would like opinions, that doing it that way means I
can embed the data in the SQL commands and not have to worry about
injection attacks since the actual SQL commands go directly from my php
script to mySQL.

Thanks for everyone's input on this.

On Thu, Jan 7, 2016 at 4:17 PM Lyn Teyla  wrote:

> Peter Haworth wrote:
>
> > Is this common practice when accessing mySQL on a host server?  If so, is
> > there a better way to set about accessing a mySQL database in these
> > circumstances, perhaps using php scripts on the server instead of
> accessing
> > the db directly with the LC database functions?
>
> One of my hosting providers HostM.com has been offering a free
> LiveCode-based MariaDB/MySQL API solution. It was previously available only
> to clients who needed this setup.
>
> I told them about the widespread interest in the LiveCode community for
> such a solution, and they’ve kindly made their API demo available for free
> download by any LiveCode developer.
>
> You can download it at:
>
> https://www.hostm.com/tutorials/livecode/api-mariadb-mysql
>
> Hope this helps!
>
> Lyn
>
>
>
> ___
> use-livecode mailing list
> use-livecode@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Re: mySQL Host access

2016-01-07 Thread Lyn Teyla
Peter Haworth wrote:

> Is this common practice when accessing mySQL on a host server?  If so, is
> there a better way to set about accessing a mySQL database in these
> circumstances, perhaps using php scripts on the server instead of accessing
> the db directly with the LC database functions?

One of my hosting providers HostM.com has been offering a free LiveCode-based 
MariaDB/MySQL API solution. It was previously available only to clients who 
needed this setup.

I told them about the widespread interest in the LiveCode community for such a 
solution, and they’ve kindly made their API demo available for free download by 
any LiveCode developer.

You can download it at:

https://www.hostm.com/tutorials/livecode/api-mariadb-mysql

Hope this helps!

Lyn



___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Re: mySQL Host access

2016-01-07 Thread Mark Wieder

On 01/07/2016 06:05 PM, Lyn Teyla wrote:


The stacks are a free download, and from what I can tell, don’t require you to 
be a HostM.com client. You just need to be able to run LiveCode Server.


Maybe.
The url *does* throw a 404, though.

--
 Mark Wieder
 ahsoftw...@gmail.com

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Re: mySQL Host access

2016-01-07 Thread Lyn Teyla
Peter Haworth wrote:

> Thanks for that info, that will certainly help me when I start looking into
> LC server.  Unfortunately, I think I'm about 6 months into a 2-year
> contract with my current web host so probably could not switch at this
> point.

The stacks are a free download, and from what I can tell, don’t require you to 
be a HostM.com client. You just need to be able to run LiveCode Server.

Lyn



___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Re: mySQL Host access

2016-01-07 Thread Peter Haworth
OK, thanks Lyn.  I will have to check with my web host (Dreamhost) how to
set LC server up.

On Thu, Jan 7, 2016 at 6:05 PM Lyn Teyla  wrote:

> Peter Haworth wrote:
>
> > Thanks for that info, that will certainly help me when I start looking
> into
> > LC server.  Unfortunately, I think I'm about 6 months into a 2-year
> > contract with my current web host so probably could not switch at this
> > point.
>
> The stacks are a free download, and from what I can tell, don’t require
> you to be a HostM.com client. You just need to be able to run LiveCode
> Server.
>
> Lyn
>
>
>
> ___
> use-livecode mailing list
> use-livecode@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Re: mySQL Host access

2016-01-07 Thread Mark Wieder

On 01/07/2016 06:43 PM, Mark Wieder wrote:


The url *does* throw a 404, though.


...and now they fixed the link.

--
 Mark Wieder
 ahsoftw...@gmail.com

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: mySQL Host access

2016-01-07 Thread Mike Bonner
I wonder if Andres Dblib could be modified so that it could be used on both
ends.  On the client side, use the where, columns etc functionality to
build up an array, (dbA) encode it, and post it to a page where its
decoded, copied to the dbA variable (after you "start using.." andres
stack) and then its a single call to interact with the database. (ok so a
bit more complicated, you'd have to set the default connection, and pass in
whethere you were doing an insert, update, or whatever) but overall I think
it would be do-able. (and there is a gpl version of the library)  It would
just have to be modded to handle the arrayencode, and posting.  And
decoding on the far side.

On Thu, Jan 7, 2016 at 12:15 PM, Peter Haworth  wrote:

> Thanks Matthias, definitely seems like php on the server is the way to go.
> I guess designing the interface protocol between the LC app and the php
> scripts is my next step.
>
> Pete
> lcSQL Software 
> Home of lcStackBrowser  and
> SQLiteAdmin 
>
> On Thu, Jan 7, 2016 at 10:17 AM, Matthias Rebbe | M-R-D <
> matthias_livecode_150...@m-r-d.de> wrote:
>
> >
> >
> > > Am 07.01.2016 um 18:34 schrieb Peter Haworth :
> > >
> > > It seems that to access a mySQL database on my web host's servers from
> a
> > > Livecode program, I have to configure "Allowable hosts" in the database
> > > configuration.  That can be an ip address or a domain name such as "@.
> > > mydomain.com”
> > >
> >
> > if i remember right you could use %.%.%.% instead of the ip address to
> > allow all ip addresses to remotely connect to the MySQL DB.
> > But i wouldn´t do that. I would create a php or lc script on the server
> > which makes all the communication with the MySQL db and then let the
> > Desktop App call the php/lc file on the server. The php/lc file would
> then
> > return the needed data to the Desktop App.
> >
> > It´s much safer then to allow remote connections to the MySQL DB.
> >
> > Matthias
> >
> > > The program in question will be used by perhaps a half dozen users, all
> > > from their home computers and likely using different internet providers
> > so
> > > it appears every time I give the program to a new user, I will have to
> > add
> > > either their ip address (if it's fixed) or a domain as above.
> > >
> > > Is this common practice when accessing mySQL on a host server?  If so,
> is
> > > there a better way to set about accessing a mySQL database in these
> > > circumstances, perhaps using php scripts on the server instead of
> > accessing
> > > the db directly with the LC database functions?
> > >
> > > Pete
> > > lcSQL Software 
> > > Home of lcStackBrowser  and
> > > SQLiteAdmin 
> > > ___
> > > use-livecode mailing list
> > > use-livecode@lists.runrev.com
> > > Please visit this url to subscribe, unsubscribe and manage your
> > subscription preferences:
> > > http://lists.runrev.com/mailman/listinfo/use-livecode
> >
> >
> > ___
> > use-livecode mailing list
> > use-livecode@lists.runrev.com
> > Please visit this url to subscribe, unsubscribe and manage your
> > subscription preferences:
> > http://lists.runrev.com/mailman/listinfo/use-livecode
> >
> ___
> use-livecode mailing list
> use-livecode@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Re: mySQL Host access

2016-01-07 Thread Earthednet-wp
Peter,
I do this on my server. I keep the php on my server. Then I only have to allow 
access from "localhost' because the php is being run on the server. The php is 
accessed with "post" command from livecode. If you need an example, I can send 
you a sample stack, with some sample php.
Bill

William Prothero
http://es.earthednet.org

> On Jan 7, 2016, at 9:34 AM, Peter Haworth  wrote:
> 
> It seems that to access a mySQL database on my web host's servers from a
> Livecode program, I have to configure "Allowable hosts" in the database
> configuration.  That can be an ip address or a domain name such as "@.
> mydomain.com"
> 
> The program in question will be used by perhaps a half dozen users, all
> from their home computers and likely using different internet providers so
> it appears every time I give the program to a new user, I will have to add
> either their ip address (if it's fixed) or a domain as above.
> 
> Is this common practice when accessing mySQL on a host server?  If so, is
> there a better way to set about accessing a mySQL database in these
> circumstances, perhaps using php scripts on the server instead of accessing
> the db directly with the LC database functions?
> 
> Pete
> lcSQL Software 
> Home of lcStackBrowser  and
> SQLiteAdmin 
> ___
> use-livecode mailing list
> use-livecode@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription 
> preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: mySQL Host access

2016-01-07 Thread Alex Tweedly
Why would you consider php scripts, when it would (I assume) be much 
more familiar for you to use .lc scripts on LCServer, or CGI, scripts ?


In fact, given it's you :-), I would think you could write such LC 
access scripts in your sleep :-), probably better than most of us.


-- Alex.

On 07/01/2016 17:34, Peter Haworth wrote:

It seems that to access a mySQL database on my web host's servers from a
Livecode program, I have to configure "Allowable hosts" in the database
configuration.  That can be an ip address or a domain name such as "@.
mydomain.com"

The program in question will be used by perhaps a half dozen users, all
from their home computers and likely using different internet providers so
it appears every time I give the program to a new user, I will have to add
either their ip address (if it's fixed) or a domain as above.

Is this common practice when accessing mySQL on a host server?  If so, is
there a better way to set about accessing a mySQL database in these
circumstances, perhaps using php scripts on the server instead of accessing
the db directly with the LC database functions?

Pete
lcSQL Software 
Home of lcStackBrowser  and
SQLiteAdmin 
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode



___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode