General Database question

Creating desktop or client-server database solutions?

Moderators: Klaus, FourthWorld, heatherlaine, robinmiller, kevinmiller

Post Reply
Pistris
Posts: 126
Joined: Mon Jul 20, 2015 2:40 am

General Database question

Post by Pistris » Fri Jul 08, 2016 7:12 pm

Hi Guys
I was reading all i could about using a middleware to access the databases and i have a question

how exactly would you request the info from the middleware in a way that is secure

it seems to me that it would be the same case as connecting to the database directly

am not looking for code examples. My background is web development so i have never needed to use the middleware since our databases are
behind firewalls with rules that only let the sql servers talk to the servers where the web pages are hosted

thank you in advance.

Edd

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 6836
Joined: Sat Apr 08, 2006 7:05 am
Location: Los Angeles
Contact:

Re: General Database question

Post by FourthWorld » Fri Jul 08, 2016 8:17 pm

Your web pages include SQL commands? No PHP on the server?
Richard Gaskin
Community volunteer LiveCode Community Liaison

LiveCode development, training, and consulting services: Fourth World Systems: http://FourthWorld.com
LiveCode User Group on Facebook : http://FaceBook.com/groups/LiveCodeUsers/

Pistris
Posts: 126
Joined: Mon Jul 20, 2015 2:40 am

Re: General Database question

Post by Pistris » Fri Jul 08, 2016 8:29 pm

yes they include sql commands

the thing is that i check the session status on all the pages before actually executing the queries
that way i keep it secure

how the process would be done in live code.

am interested in making a complete middleware package so i dont need to write code over and over

on another note, i read everything you post, they are a good source of information

thanks for your quick response and all the time you spend helping the livecode community (am sure you get this all the time)

Edd.

ghettocottage
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 312
Joined: Tue Apr 10, 2012 9:18 am

Re: General Database question

Post by ghettocottage » Fri Jul 08, 2016 11:34 pm

Your web pages include SQL commands? No PHP on the server?
I think what Richard is getting at is that if you are using PHP, you are using middleware.

In the case of Livecode, there is Livecode server, which you can set up on your webserver and use it much like PHP. Or, if you are using Livecode to create an application that will not live on your server, then you can send your requests to some middleware on your server (such as PHP or Livecode Server) and that will output your data back to your application

There are different ways to encrypt and/or encode that data (to and from the server), so that your middleware will have keys or password or salt and can de-crypt/de-code your query, get your requested data, re-encrypt/re-encode it and send it back to you.

Here is one thread about this:

http://forums.livecode.com/viewtopic.php?t=23812

Is there a specific project you are working on, or are you just exploring ideas?

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 6836
Joined: Sat Apr 08, 2006 7:05 am
Location: Los Angeles
Contact:

Re: General Database question

Post by FourthWorld » Sat Jul 09, 2016 2:57 am

Thank you for the kind words, Pistris. Now I have to see if I can live up to them. :)

PHP is the most common solution for middleware, and there are innumerable tutorials for using it with MySQL.

LiveCode Server can also be used in that role - these Lessons may help you get started:
http://lessons.livecode.com/m/4070

Bonus points: if you don't already have an SSL cert on your server, it's never been easier now that the Let's Encrypt project is here - completely free with automated renewals once it's set up:
https://letsencrypt.org/

Some shared hosts like Dreamhost provide support for Let's Encrypt, and hosts using CPanel will have support for it there next month.

If you're using a dedicated host or VPS running Ubuntu, the latest version (16.04) now provides Let's Encrypt through its package repository, so it can be installed via the normal package manager, apt-get.
Richard Gaskin
Community volunteer LiveCode Community Liaison

LiveCode development, training, and consulting services: Fourth World Systems: http://FourthWorld.com
LiveCode User Group on Facebook : http://FaceBook.com/groups/LiveCodeUsers/

Pistris
Posts: 126
Joined: Mon Jul 20, 2015 2:40 am

Re: General Database question

Post by Pistris » Mon Jul 11, 2016 6:52 pm

Hi Richard

By reading my own post i think i answered my question

i guess what i need to know is how to communicate securely

how to post data to my web pages securely from within livecode (IOS)

Thanks

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 6836
Joined: Sat Apr 08, 2006 7:05 am
Location: Los Angeles
Contact:

Re: General Database question

Post by FourthWorld » Mon Jul 11, 2016 7:25 pm

Use https instead of http. If your server is properly configured the rest just works.
Richard Gaskin
Community volunteer LiveCode Community Liaison

LiveCode development, training, and consulting services: Fourth World Systems: http://FourthWorld.com
LiveCode User Group on Facebook : http://FaceBook.com/groups/LiveCodeUsers/

Pistris
Posts: 126
Joined: Mon Jul 20, 2015 2:40 am

Re: General Database question

Post by Pistris » Mon Jul 11, 2016 9:12 pm

ok so dumb question then
all i need to do change is

post myData to URL "http://www.address.com/mypage.html"

for

post myData to URL "https://www.address.com/mypage.html" ?

Pistris
Posts: 126
Joined: Mon Jul 20, 2015 2:40 am

Re: General Database question

Post by Pistris » Wed Jul 13, 2016 3:37 am

Am I right?

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 6836
Joined: Sat Apr 08, 2006 7:05 am
Location: Los Angeles
Contact:

Re: General Database question

Post by FourthWorld » Wed Jul 13, 2016 4:13 am

As long as the server is set up for HTTPS, yep, that should do it.
Richard Gaskin
Community volunteer LiveCode Community Liaison

LiveCode development, training, and consulting services: Fourth World Systems: http://FourthWorld.com
LiveCode User Group on Facebook : http://FaceBook.com/groups/LiveCodeUsers/

Pistris
Posts: 126
Joined: Mon Jul 20, 2015 2:40 am

Re: General Database question

Post by Pistris » Wed Jul 13, 2016 4:47 am

Thank u
Am gonna try it tomorrow.

Pistris
Posts: 126
Joined: Mon Jul 20, 2015 2:40 am

Re: General Database question

Post by Pistris » Wed Jul 13, 2016 10:06 pm

IS the hosting account that comes with the livecode account already setup with ssl certificates and ready to use HTTPS ?

Post Reply

Return to “Databases”